GET '/api/v1/users/:id’
Example response of the User resource
{
"data": {
"id": "integer",
"type": "string",
"attributes": {
"first_name": "string",
"last_name": "string",
"username": "string",
"email": "string",
"stats": {
"lions_saved": "integer",
"recipes_cooked": "integer",
"recipes_created": "integer"
}
}
}
}
POST '/api/v1/users’
Example of the body details to be provided when creating a user
{
"first_name": "string",
"last_name": "string",
"username": "string",
"email": "string",
"password": "string",
"password_confirmation": "string"
}
POST ‘/api/v1/user/:user_id/recipes’
Example of the body details to be provided when creating a cooked recipe
{
"user_id": "integer",
"recipe_id": "integer",
"instructions": "string",
"image_url": "string",
"cook_time": "integer",
"public_status": "boolean"
}
POST ‘/api/v1/user/:user_id/recipes/:recipe_id?value=cooked’
Example of the body details to be provided when creating a cooked recipe
{
"user_id": "integer",
"recipe_id": "integer",
"cook_status": "boolean"
}
POST ‘/api/v1/user/:user_id/recipes/:recipe_id?value=saved’
Example of the body details to be provided when creating a saved recipe
{
"user_id": "integer",
"recipe_id": "integer",
"saved_status": "boolean"
}
PATCH ‘/api/v1/user/:user_id/recipes/:recipe_id?value=rate’
Example of the body details to be provided when updating (rating) a cooked recipe
{
"user_id": "integer",
"recipe_id": "integer",
"cook_status": "boolean",
"num_stars": "integer"
}
PATCH '/api/v1/users/:id’
Example of the body details to be provided when updating a user
{
"id": "integer",
"name": "string",
"username": "string",
"email": "string"
}
GET '/api/v1/users/:id/recipes?value=cooked'
Example response of a Users Recipes resource
Params: value=cooked
{
"data": [
{
"id": "string",
"type": "string",
"attributes": {
"name": "string"
}
},
{
"id": "string",
"type": "string",
"attributes": {
"name": "string"
}
}
]
}
GET '/api/v1/users/:id/recipes?value=created'
Example response of a Users Recipes resource
Params: value=created
{
"data": [
{
"id": "string",
"type": "string",
"attributes": {
"name": "string"
}
},
{
"id": "string",
"type": "string",
"attributes": {
"name": "string"
}
}
]
}
GET '/api/v1/users/:id/recipes?value=saved'
Example response of a Users Recipes resource
Params: value=saved
{
"data": [
{
"id": "string",
"type": "string",
"attributes": {
"name": "string"
}
},
{
"id": "string",
"type": "string",
"attributes": {
"name": "string"
}
}
]
}
GET '/api/v1/recipes/:id'
Example response of a Recipes resource
{
"id": "string",
"type": "string",
"attributes": {
"image_url": "string",
"name": "string",
"rating_from_api": "float",
"cook_time": "integer",
"public_status": "boolean",
"ingredients": [
{
"name": "string",
"units": "float",
"unit_type": "string"
},
{
"name": "string",
"units": "float",
"unit_type": "string"
}
],
"source_name": "string",
"source_url": "string",
"instructions": ["string", "string", ...]
}
}
PATCH '/api/v1/user/:user_id/recipes/:recipe_id’
Example of the body details to be provided when updating a recipe
{
"user_id": "integer",
"recipe_id": "integer",
"name": "string",
"cook_time": "integer",
"source_name": "string"
}
DELETE '/api/v1/user/:user_id/recipes/:recipe_id’
Example of the body details to be provided when deleting a recipe
{
"user_id": "integer",
"recipe_id": "integer"
}
GET '/api/v1/users/:id/chefs’
Example response of the Users Chefs resource
{
"data": [
{
"id": "string",
"type": "string",
"attributes": {
"name": "string",
"username": "string"
},
{
"id": "string",
"type": "string",
"attributes": {
"name": "string",
"username": "string"
}
}
}
GET '/api/v1/ingredients'
Example response of the Ingredients resource
{
"data": [
{
"name": "string"
},
{
"name": "string"
},
{
"name": "string"
}
]
}
GET ‘/api/v1/recipes/search?name=query%string’
Example of a response from the Search (by name) resource
{
"data": [
{
"id": "string",
"type": "string",
"attributes": {
"name": "string",
}
},
{
"id": "string",
"type": "string",
"attributes": {
"name": "string",
}
}
]
}
GET ‘/api/v1/recipes/search?ingredient=query%string,+query’
Example of a response from the Search (by ingredients(s) ) resource
{
"data": [
{
"id": "string",
"type": "string",
"attributes": {
"name": "string",
}
},
{
"id": "string",
"type": "string",
"attributes": {
"name": "string",
}
}
]
}