Description: Fetch users info.
-
Request:
- Method:
GET - URL:
/api/users?email={email}
- Method:
-
Response:
- All information about that specific user
Description: Create a new user.
-
Request:
- Method:
POST - URL:
/api/users - Headers:
{ "Content-Type": "application/json" } - Body:
{ "email": "[email protected]", "name": "jane", "allergies": "shrimp,gluten", //optional param "dislikes": "mustard,tomato" //optional param }
- Method:
-
Response:
- Information of new user
Description: Update a user's allergies & dislikes.
-
Request:
- Method:
PUT - URL:
/api/users - Headers:
{ "Content-Type": "application/json" } - Body:
{ "email": "email", "name": "jane", "allergies": "shrimp,gluten", "dislikes": "mustard,tomato" }
- Method:
-
Response:
- User's information with updated values
Description: Fetch all favorite items of a user.
-
Request:
- Method:
GET - URL:
/api/favs?email={email_of_user}
- Method:
-
Response:
- Status:
200 OK - Body:
[ { "id": "1", "recipe": "xyz", "name": "Pizza", "ingredients": "onion,tomato" } ]
- Status:
Description: Add an item to favorites.
-
Request:
- Method:
POST - URL:
/api/favs - Headers:
{ "Content-Type": "application/json" } - Body:
{ "email": "[email protected]", "name": "Burger", "recipe": "xyz", "ingredients": "salt, water" }
- Method:
-
Response:
- List of all favories of the user
Description: Remove one favorite item if id present. Else, remove all favorites of the user.
-
Request:
- Method:
DELETE - URL:
/api/favs?id={id}id is optional, removes all if id not present - Body:
{ "email": "[email protected]" }
- Method:
-
Response:
- All the favorite recipes of the user.
Description: Fetch inventory of a user.
-
Request:
- Method:
GET - URL:
/api/inventory?email={email_of_user}
- Method:
-
Response:
- Status:
200 OK - Body:
[ { "id": "1", "email": "[email protected]", "details": "allergic to..." } ]
- Status:
Description: Add an user's details to inventory
-
Request:
- Method:
POST - URL:
/api/inventory - Headers:
{ "Content-Type": "application/json" } - Body:
{ "email": "[email protected]", "details": "somehting...." }
- Method:
-
Response:
- List info of the user
Description: Remove an inventory item by its id. If no id is provided, it removes all inventory items for the user.
-
Request:
- Method:
DELETE - URL:
/api/inventory?id={id}id is optional, removes all if id not present - Body:
{ "email": "[email protected]" }
- Method:
-
Response:
- All the favorite recipies of the user.