- API Documentation
- 1. Users
- 2. Lists
- 3. Items
- 4. Recipes
- 4.1 Get all the recipes in the system: [GET]
/v1/recipe[?offset=[INTEGER DEFAULT=0]&limit=[INGETER DEFAULT=300]]
- 4.2 Get ingredients for recipe: [GET]
/v1/recipe/:id/ingredients
- 4.3 Add ingredients: [GET]
/v1/recipe/:id/add
- 4.4 Suggest recipes: [GET]
/v1/recipe/suggest[?q=[INTEGER 1-100] DEFAULT 100]
- 4.1 Get all the recipes in the system: [GET]
Gets all the users. Only accepts admin tokens.
- Authentication:
[Admin, User]
token
: User token must be the one assigned to the target user or an admin token.
- Header:
{'Authorization': 'Bearer TOKEN'}
{
users: [
{
"id": [INTEGER],
"first_name": [STRING],
"last_name": [STRING],
"email": [STRING],
"username": [STRING],
"token": [STRING],
"updatedAt": [STRING],
"createdAt": [STRING]
},
]
}
- Success Code:
{200: 'Success'}
- Error Code:
{401: 'Unauthorized'}
Get the user associated with the token.
- Authentication:
[User]
token
: User token must be the one assigned to the target user or an admin token.
- Header:
{'Authorization': 'Bearer TOKEN'}
{
"id": [INTEGER],
"first_name": [STRING],
"last_name": [STRING],
"email": [STRING],
"username": [STRING],
"token": [STRING],
"updatedAt": [STRING],
"createdAt": [STRING]
}
- Success Code:
{200: 'Success'}
- Error Code:
{401: 'Unauthorized'}
Creates a new user.
- Authentication:
[]
- Body:
{
"first_name": [STRING],
"last_name": [STRING],
"email": [STRING],
"username": [STRING],
"password": [STRING]
}
{
"id": [INTEGER],
"first_name": [STRING],
"last_name": [STRING],
"email": [STRING],
"username": [STRING],
"token": [STRING],
"updatedAt": [STRING],
"createdAt": [STRING]
}
- Success Code:
{201: 'Created'}
- Error Code:
{404: 'NotFoundError', 409: 'ConflictError'}
Deletes the user with the given id
.
- Authentication:
[Admin, User]
- Header:
{'Authorization': 'Bearer TOKEN'}
- body:
{}
- Success Code:
{204: 'NoContent'}
- Error Code:
{403: 'Forbidden', 404: 'NotFoundError'}
Get all the lists for a given user.
- Authentication:
[Admin, User]
- Header:
{'Authorization': 'Bearer TOKEN'}
{
list: [
{
"id": [INTEGER],
"userId": [INTEGER],
"name": [STRING],
"description": [STRING],
"updatedAt": [STRING],
"createdAt": [STRING]
}
]
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden'}
Get specified list for a user.
- Authentication:
[Admin, User]
token
: User token must be the one assigned to the target user or an admin token.
- Header:
{'Authorization': 'Bearer TOKEN'}
{
"id": [INTEGER],
"userId": [INTEGER],
"description": [STRING],
"name": [STRING],
"description": [STRING],
"items": [
{
"id": [INTEGER],
"name": [STRING],
"quantity": [INTEGER],
"price": [INTEGER],
"expiration": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"listId": [INTEGER]
}
]
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden', 404: 'NotFoundError'}
Creates a new user.
- Authentication:
[Admin]
- Header:
{'Authorization': 'Bearer TOKEN'}
- Body:
{
"name": [STRING],
"description": [STRING]
}
{
"id": [INTEGER],
"name": [STRING],
"description": [STRING],
"updatedAt": [STRING],
"createdAt": [STRING]
}
- Success Code:
{201: 'Created'}
- Error Code:
{403: 'Forbidden', 409: 'ConflictError'}
Deletes the list with the given id
.
- Authentication:
[Admin, User]
- Header:
{'Authorization': 'Bearer TOKEN'}
- Params:
id
of the user to be deleted.
- body:
{}
- Success Code:
{204: 'NoContent'}
- Error Code:
{403: 'Forbidden', 404: 'NotFoundError'}
Add an item to the given list
- Authentication:
[User]
- Header:
{'Authorization': 'Bearer TOKEN'}
{
"list": {
"id": [INTEGER],
"name": [STRING],
"description": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"userId": [INTEGER],
"items": [
{
"id": [INTEGER],
"name": [STRING],
"quantity": [INTEGER],
"price": [INTEGER],
"expiration": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"listId": [INTEGER]
},
]
}
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden'}
Move item from the grocery list to the fridge list
- Authentication:
[User]
- Header:
{'Authorization': 'Bearer TOKEN'}
{
"list": {
"id": [INTEGER],
"name": [STRING],
"description": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"userId": [INTEGER],
"items": [
{
"id": [INTEGER],
"name": [STRING],
"quantity": [INTEGER],
"price": [INTEGER],
"expiration": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"listId": [INTEGER]
},
]
}
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden'}
Delete an item from a given list
- Authentication:
[User]
- Header:
{'Authorization': 'Bearer TOKEN'}
{
"list": {
"id": [INTEGER],
"name": [STRING],
"description": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"userId": [INTEGER],
"items": [
{
"id": [INTEGER],
"name": [STRING],
"quantity": [INTEGER],
"price": [INTEGER],
"expiration": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"listId": [INTEGER]
},
]
}
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden'}
Update an expiration date
- Authentication:
[User]
- Header:
{'Authorization': 'Bearer TOKEN'}
- Body:
{
"expiration": [STRING YYYY-MM-DD]
}
{
"list": {
"id": [INTEGER],
"name": [STRING],
"description": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"userId": [INTEGER],
"items": [
{
"id": [INTEGER],
"name": [STRING],
"quantity": [INTEGER],
"price": [INTEGER],
"expiration": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"listId": [INTEGER]
},
]
}
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden'}
4.1 Get all the recipes in the system: [GET] /v1/recipe[?offset=[INTEGER DEFAULT=0]&limit=[INGETER DEFAULT=300]]
- Offset
n
is then
th items you want to skip. Default = 0; - limit is the number of recipes you want. Default is all of them.
- Authentication:
[User]
- Header:
{'Authorization': 'Bearer TOKEN'}
{
"recipes": [
{
"id": [INTEGER],
"sourceUrl": [STRING],
"cheap": [BOOLEAN],
"vegan": [BOOLEAN],
"cookingMinutes": [INTEGER],
"title": [STRING],
"dairyFree": [BOOLEAN],
"externalId": [INTEGER],
"preparationMinutes": [INTEGER],
"extendedIngredients": [STRING],
"vegetarian": [BOOLEAN],
"createdAt": [STRING],
"updatedAt": [STRING]
},
]
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden'}
- Authentication:
[User]
- Header:
{'Authorization': 'Bearer TOKEN'}
{
"ingredients": [
{
"originalString": [STRING],
"aisle": [STRING],
"name": [STRING],
"metaInformation": [ [STRING], ],
"image": [STRING],
"unitLong": [STRING],
"unitShort": [STRING],
"amount": [INTEGER],
"id": [INTEGER],
"unit": [STRING],
}
]
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden'}
- Authentication:
[User]
- Header:
{'Authorization': 'Bearer TOKEN'}
{
"list": {
"id": [INTEGER],
"name": [STRING],
"description": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"userId": [INTEGER],
"items": [
{
"id": [INTEGER],
"name": [STRING],
"quantity": [INTEGER],
"price": [INTEGER],
"expiration": [STRING],
"createdAt": [STRING],
"updatedAt": [STRING],
"listId": [INTEGER]
}
]
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden'}
- Percentage is the percent of ingredients that must intersect for it to be in the resulting set
- Authentication:
[User]
- Header:
{'Authorization': 'Bearer TOKEN'}
{
"recipes": [
{
"id": [INTEGER],
"sourceUrl": [STRING],
"cheap": [BOOLEAN],
"vegan": [BOOLEAN],
"cookingMinutes": [INTEGER],
"title": [STRING],
"dairyFree": [BOOLEAN],
"externalId": [INTEGER],
"preparationMinutes": [INTEGER],
"extendedIngredients": [STRING],
"vegetarian": [BOOLEAN],
"createdAt": [STRING],
"updatedAt": [STRING]
},
]
}
- Success Code:
{200: 'Success'}
- Error Code:
{403: 'Forbidden'}