Documentation
Create a recipe
Creates an authors recipe
URL http://localhost:8080/api/v1.0/recipe/create
Method POST
URL Params None
Data Params
Required
title=[string]
subtitle=[string]
description=[string]
authorId=[integer]
steps=[array[{description:string, number:integer, recipeId:integer}]]
Optional
categoryId=[integer]
files=[array]
Success Response 201
Error Response 404
Example
fetch('http://localhost:8080/api/v1.0/recipe/create, {
method: 'POST',
data: {
title: 'Cheesecake',
subtitle: 'The best cheesecake ever',
categoryId: 5,
authorId: 1,
steps: [{
description: 'Mix ingredients',
number: 1,
recipeId: 1
}, {
description: 'Put it in the fridge',
number: 2,
recipeId: 1
}]
}
})
.then((data) => {
//do something
})
Update recipe
Updates an authors recipe
URL http://localhost:8080/api/v1.0/recipe/update
Method POST
URL Params None
Data Params
Required
id=[integer]
title=[string]
subtitle=[string]
description=[string]
steps=[array[{description:string, number:integer, recipeId:integer}]]
Optional
categoryId=[integer]
files=[array]
Success Response 200
Error Response 404
Example
fetch('http://localhost:8080/api/v1.0/recipe/update, {
method: 'PUT',
data: {
title: 'Cheesecake',
subtitle: 'The best cheesecake ever',
categoryId: 5,
authorId: 1,
steps: [{
description: 'Mix ingredients',
number: 1,
recipeId: 1
}, {
description: 'Put it in the fridge',
number: 2,
recipeId: 1
}]
}
})
.then((data) => {
//do something
})
Get latest recipes
Fetch the latest recipes from the database with passing in optional page number paramater
URL /api/v1.0/recipe/latest
Method GET
URL Params page=[integer]
Data Params None
Success Response 200
Error Response 404
Example
fetch('http://localhost:8080/api/v1.0/recipe/latest?page=1')
.then((data) => {
//do something
})