Note
Currently under construction will update when app is done
The recipex API is designed for managing recipes and facilitating user interactions. It provides a robust interface for creating, retrieving, updating, and deleting recipes, as well as handling user accounts and reviews.
API Version: 2.0
OpenAPI Specification Version: 3.0.1
The base URL for the API is:
http://localhost:8080
http://localhost:8080/swagger-ui/index.html
The API does not currently require authentication. However, implementing user authentication is recommended for production use.
- Endpoint:
/recipe
- Method:
PUT
- Description: Update the details of a specific recipe.
- Request Body:
RestUserRecipe
(JSON)
- Responses:
- 200: Recipe successfully updated.
- 400: Invalid input or recipe not found.
- Endpoint:
/recipe
- Method:
DELETE
- Description: Remove a recipe using its ID.
- Request Body:
Ids
(JSON)
- Responses:
- 200: Recipe successfully deleted.
- 404: Recipe not found.
- Endpoint:
/recipe/{recipeId}
- Method:
GET
- Description: Fetch details of a specific recipe using its unique ID.
- Parameters:
recipeId
(string) - The ID of the recipe.
- Responses:
- 200: Recipe details retrieved.
- 404: Recipe not found.
- Endpoint:
/recipes/by-title/{title}
- Method:
GET
- Description: Search and retrieve recipes based on their title.
- Parameters:
title
(string) - The title of the recipe.
- Responses:
- 200: Recipes retrieved.
- 404: No recipes found with the specified title.
- Endpoint:
/recipes/by-tags
- Method:
GET
- Description: Search and retrieve recipes based on a list of tags.
- Parameters:
tags
(array of strings) - List of tags to filter recipes.
- Responses:
- 200: Recipes retrieved.
- 404: No recipes found for the specified tags.
- Endpoint:
/{recipeId}/reviews
- Method:
POST
- Description: Submit a review for the specified recipe.
- Parameters:
recipeId
(string) - The ID of the recipe.
- Request Body:
Review
(JSON)
- Responses:
- 200: Review successfully created.
- 404: Recipe not found.
- Endpoint:
/{recipeId}/reviews
- Method:
GET
- Description: Retrieve all reviews associated with the specified recipe.
- Parameters:
recipeId
(string) - The ID of the recipe.
- Responses:
- 200: Reviews retrieved successfully.
- 404: Recipe not found.
- Endpoint:
/user
- Method:
POST
- Description: Create a user by providing a username.
- Request Body:
Username
(JSON)
- Responses:
- 200: User successfully created.
- 400: Invalid input.
- Endpoint:
/user/{userId}
- Method:
GET
- Description: Retrieve user details using the unique user ID.
- Parameters:
userId
(string) - The ID of the user.
- Responses:
- 200: User details retrieved.
- 404: User not found.
- Endpoint:
/user/{userId}
- Method:
DELETE
- Description: Delete the user associated with the specified user ID.
- Parameters:
userId
(string) - The ID of the user.
- Responses:
- 200: User successfully deleted.
- 404: User not found.
- Endpoint:
/image/{recipeId}
- Method:
GET
- Description: Retrieve the image associated with the specified recipe.
- Parameters:
recipeId
(string) - The ID of the recipe.
- Responses:
- 200: Image retrieved successfully.
- 404: Image or recipe not found.
- Endpoint:
/image/{recipeId}
- Method:
POST
- Description: Upload an image for the specified recipe.
- Parameters:
recipeId
(string) - The ID of the recipe.
- Responses:
- 200: Image uploaded successfully.
- 404: Recipe not found.
{
"recipeId": "string (uuid)",
"userId": "string (uuid)",
"title": "string",
"description": "string",
"ingredients": ["string"],
"instructions": ["string"],
"tags": ["string"],
"imageUrl": "string",
"imageUploadUrl": "string",
"createdAt": "string (date-time)",
"reviews": [
{
"reviewId": "string (uuid)",
"recipeId": "string",
"userId": "string",
"rating": "integer",
"comment": "string",
"createdAt": "string (date-time)"
}
],
"averageRating": "number"
}
{
"userId": "123e4567-e89b-12d3-a456-426614174000",
"name": "string",
"surname": "string",
"email": "string",
"password": "string",
"recipes": [
{
"recipeId": "123e4567-e89b-12d3-a456-426614174001",
"title": "string",
"description": "string",
"ingredients": ["string"],
"instructions": ["string"],
"tags": ["string"],
"imageUrl": "string",
"createdAt": "2024-10-22T10:00:00Z"
}
]
}
{
"recipeId": "string",
"userId": "string",
"rating": "integer",
"comment": "string",
"createdAt": "string (date-time)"
}