RestAPI reference
On this page you can check the RestAPI endpoints.
Note
The API has build in csrf protection you may need to attach Cookie
with value csrftoken=token to work proparly
v2.0 v1.0
Authentication
Create admin user
POST /api/auth/signup
Payload
authentication.UserSerializer {
"username" : "username" ,
"password" : "password" ,
"email" : "email" ,
"is_superuser" : true
}
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
201
application/json
User created successfully
400
application/json
{"username":["user with this username already exists."]}
Example cURL
curl --location 'host/api/auth/signup' --header 'X-Auth-Header: X_AUTH_HEADER' --header 'Content-Type: application/json' --data '{"username":"username","password":"password","email":"email","is_superuser":true}'
Obtain access token
POST /api/auth/token
Payload
authentication.UserSerializer {
"email" : "email" ,
"password" : "password"
}
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
{"token":"token","user":{"username":"username","email":"email","is_superuser":true}}
404
application/json
{"detail":"No User matches the given query."}
403
application/json
{"detail": "You must use authentication header"}
Example cURL
` curl --location 'host/api/auth/token' --header 'X-Auth-Header: X_AUTH_HEADER' --header 'Content-Type: application/json' --data '{"email":"email","password":"password"}' '
Get user profile info
GET /api/auth/user/info
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Responses
http code
content-type
response
200
application/json
{"username":"username","email":"email","date_joined":"date"}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'localhost:8080/api/auth/user/info' --header 'Authorization: Token token_value'
Change user password
PUT /api/auth/user
Payload
{
"old_password" : "password" ,
"new_password" : "password"
}
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Responses
http code
content-type
response
204
application/json
{}
400
application/json
{"message": "Old password does not match current password"}
403
application/json
{"detail": "Authentication credentials were not provided."}
Example cURL
curl --location --request PUT 'host/api/auth/user' --header 'Authorization: Token token_value' --header 'Content-Type: application/json' --data '{"old_password":"old_password","new_password":"new_password"}'
Update user email and username
PATCH /api/auth/user
Info
Individual fields can be updated only username or password.
Payload
authentication.UserSerializer {
"username" : "new_username" ,
"email" : "new_email"
}
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Responses
http code
content-type
response
200
application/json
{"username":"new_username","email":"new_email","is_superuser":true}
400
application/json
{"email":["Enter a valid email address and password."]}
403
application/json
{"detail": "Authentication credentials were not provided."}
Example cURL
curl --location --request PATCH 'host/api/auth/user' --header 'Authorization: Token token_value' --header 'Content-Type: application/json' --data-raw '{"username":"new_username","email":"new_email"}'
Delete user account
DELETE /api/auth/delete-account
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Responses
http code
content-type
response
204
application/json
No Content
403
application/json
{"detail": "Authentication credentials were not provided."}
Example cURL
curl --location --request DELETE 'host/api/auth/delete-account' --header 'Authorization: Token token_value'
Request password reset token for user account
POST /api/auth/password_reset
Payload
authentication.ResetPasswordRequestSerializer {
"email" : "user_email"
}
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
201
application/json
{"token":"token_value"}
403
application/json
{"detail":"You must use authentication header"}
404
application/json
{"error":"User with provided email not found"}
Example cURL
curl --location 'host/api/auth/password_reset' --header 'Content-Type: application/json' --header 'X-Auth-Header: auth_header_value' --data-raw '{"email":"user_email"}'
Change user password with token
POST /api/auth/password_reset/reset
##### Parameters
name
type
data type
description
token
query (required)
string
Token obtained from POST /api/auth/password_reset
Payload
{
"password" : "new_password" ,
"confirm_password" : "new_password"
}
Responses
http code
content-type
response
204
application/json
No Content
404
application/json
{"detail":"No PasswordResetToken matches the given query."}}
Example cURL
curl --location 'host/api/auth/password_reset/reset?token=token_value' --header 'Content-Type: application/json' --data '{"password":"new_password","confirm_password":"new_password"}'
Recipe
Search for recipes
GET /api/recipe/home/
Parameters
name
type
data type
description
search
query (optional)
string
Part or fulll name of the recipe.Recipe object
page
query (optional)
int
Page number if there a mutilple pages result
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
{"count":int,"next":string,"previous":string,"results":[recipe.Recipe obj list]}
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'http://host:port/api/recipe/home/?name=name&page=1' --header ' X-Auth-Header: X_AUTH_HEADER
Get favorite recipes
GET /api/recipe/home/favorites/
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
{"count":int,"next":string,"previous":string,"results":[recipe.Recipe obj list]}
404
application/json
{"detail":"No Recipe matches the given query."}
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'http://host:port/api/recipe/home/favorites/' --header ' X-Auth-Header: X_AUTH_HEADER
Get trending recipes
GET /api/recipe/trending
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
[recipe.Recipe objects list]
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'localhost:8080/api/recipe/trending' --header ' X-Auth-Header: X_AUTH_HEADER
Search for recipes preview
GET /api/recipe/home/preview/
Parameters
name
type
data type
description
search
query (optional)
string
Part or fulll name of the recipe.Recipe object
page
query (optional)
int
Page number if there a mutilple pages result
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
{"count":int,"next":string,"previous":string,"results":[recipe.RecipePreviewSerializer obj list]}
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'http://host:port/api/recipe/home/preview/?name=name&page=1' --header ' X-Auth-Header: X_AUTH_HEADER
Update favorite status
PATCH /api/recipe/int:pk/favorite
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to be favorited or unfavorited
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Responses
http code
content-type
response
201
application/json
"Success favorite recipe"
201
application/json
"Success unfavorite recipe"
403
application/json
`{"detail":"You must use authentication header"}
404
application/json
Not Found
Example cURL
curl --location --request PATCH 'host/api/recipe/1/favorite' --header 'X-Auth-Header: X_AUTH_HEADER'
Create recipe
POST /api/recipe/
Payload
recipe.Recipe object {
"image" : f ile ,
"name" : s tr i n g ,
"serves" : i nt ,
"description" : s tr i n g ,
"difficulty" : s tr i n g (DIFFICULTY_CHOICES) ,
"chef" : s tr i n g
"video" : f ile (op t io nal ) ,
"category" : <i nt : pk> (op t io nal ) ,
"tag" : <i nt : pk> (op t io nal ) ,
"prep_time" : i nt ,
"cook_time" : i nt
}
Dificulty choices (DIFFICULTY_CHOICES)
recipe.Recipe.DIFFICULTY_CHOICES (use only the key in the request) ( 'Easy' , 'Easy' ),
( 'Intermediate' , 'Intermediate' ),
( 'Advanced' , 'Advanced' ),
( 'Expert' , 'Expert' ),
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Content-Type
multipart/form-data
Recipe object
Recipe multipart/form-data object
Responses
http code
content-type
response
201
application/json
{recipe.Recipe object}
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'host/api/recipe/' --header 'Authorization: Token token_value' --form 'image=@"/path/image.jpg"' --form 'name="Recipe name"' --form 'servings="5"' --form 'category="1"' --form 'tag="1"' --form 'prep_time="20"' --form 'video=@"/path/video.mp4"' --form 'description="This is cool recipe"' --form 'cook_time="45"'
Update recipe main info (without ingredients and steps)
PUT /api/recipe/int:pk
Payload
recipe.Recipe object {
"image" : f ile ,
"name" : s tr i n g ,
"serves" : i nt ,
"description" : s tr i n g ,
"difficulty" : s tr i n g (DIFFICULTY_CHOICES) ,
"chef" : s tr i n g
"video" : f ile (op t io nal ) ,
"category" : <i nt : pk> (op t io nal ) ,
"tag" : <i nt : pk> (op t io nal ) ,
"prep_time" : i nt ,
"cook_time" : i nt ,
"clear_video" : boolea n (op t io nal i f you wa nt t o dele te already se t video)
}
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to be updated
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Content-Type
multipart/form-data
Recipe object
Recipe multipart/form-data object
Responses
http code
content-type
response
200
application/json
{recipe.Recipe object}
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location --request PUT 'host/api/recipe/1' --header 'Authorization: Token token_value' --form 'image=@"/path/image.jpg"' --form 'name="Recipe name"' --form 'servings="5"' --form 'category="1"' --form 'tag="1"' --form 'prep_time="20"' --form 'video=@"/path/video.mp4"' --form 'description="This is cool recipe"' --form 'cook_time="45"'
Delete recipes
DELETE /api/recipe/pk:int/
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to be deleted
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Responses
http code
content-type
response
204
application/json
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location --request DELETE 'host/api/recipe/<int:pk>/' --header 'Authorization: Token token_value'
Category
Get all categories
GET /api/recipe/category
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
[recipe.Category objects list]
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'host/api/recipe/category' --header 'X-Auth-Header: X_AUTH_HEADER'
Get all categories recipes
GET /api/recipe/category/int:pk/recipes
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Category primary key
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
[recipe.Recipe objects list]
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'host/api/recipe/category/1/recipes' --header 'X-Auth-Header: X_AUTH_HEADER'
Create category
POST /api/recipe/category/add
Payload
recipe.Category object {
"name" : s tr i n g
}
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
201
application/json
{recipe.Category object}
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'host/api/recipe/category/add' --header 'Authorization: Token token_value' --data '{"name":"Greek"}'
Update category
PUT /api/recipe/category/int:pk
Payload
recipe.Category object {
"name" : s tr i n g ,
}
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Category primary key
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
200
application/json
{recipe.Recipe object}
401
application/json
{"detail":"Authentication credentials were not provided."}
404
application/json
{"detail":"No Category matches the given query."}
Example cURL
curl --location --request PUT 'host/api/recipe/category/6' --header 'Authorization: Token token_value' --header 'Content-Type: application/json' --data '{"name":"Italiano"}'
Tag
GET /api/recipe/tags
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
[recipe.Tag objects list]
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'host/api/recipe/tags' --header 'X-Auth-Header: X_AUTH_HEADER'
Get all recipes from tag
GET /api/recipe/tag/int:pk/recipes
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Tag primary key
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
{"count":int,"next":string,"previous":string,"results":[recipe.Recipe obj list]}
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'host/api/recipe/tag/<int:pk>/recipes' --header 'X-Auth-Header: X_AUTH_HEADER'
Create tag
POST /api/recipe/tag/add
Payload
recipe.Tag object {
"name" : s tr i n g
}
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
201
application/json
{recipe.Category object}
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'host/api/recipe/tag/add' --header 'Authorization: Token token_value' --data '{"name":"Summer vibes"}'
Update tag
PUT /api/recipe/tag/int:pk
Payload
recipe.Category object {
"name" : s tr i n g ,
}
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Tag primary key
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
200
application/json
{recipe.Tag object}
401
application/json
{"detail":"Authentication credentials were not provided."}
404
application/json
{"detail":"No Category matches the given query."}
Example cURL
curl --location --request PUT 'host/api/recipe/tag/1' --header 'Authorization: Token token_value' --header 'Content-Type: application/json' --data '{"name":"Summer Vibes"}'
Ingredients
POST /api/recipe/int:pk/ingredients
Info
Override already existing ingredients for the recipe
Payload
recipe.Igredient object list [
{
"name" : "string,
" qua nt i t y ": string,
" me tr ic ": " s tr i n g
},
{
"name" : "string,
" qua nt i t y ": string,
" me tr ic ": " s tr i n g
},
....
]
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to which to link the ingredients
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
201
application/json
[{recipe.Ingrediant object}]
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'host/api/recipe/ingredients' --header 'Authorization: Token token_value' --data '[{"name":"Kasher salt","quantity":"1/5","metric":"tbsp","recipe":24}]'
Steps
POST /api/recipe/int:pk/steps
Info
Override already existing steps for the recipe
Payload
recipe.Step object list [
{
"text" : s tr i n g
},
{
"text" : s tr i n g
},
....
]
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to which to link the steps
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
201
application/json
[{recipe.Step object}]
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'host/api/recipe/ingredients' --header 'Authorization: Token token_value' --data '[{"text":"Heat the oven","recipe":1}]'
Authentication
Create admin user
POST /api/auth/signup
Payload
authentication.UserSerializer {
"username" : "username" ,
"password" : "password" ,
"is_superuser" : true
}
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
201
application/json
User created successfully
400
application/json
{"username":["user with this username already exists."]}
Example cURL
curl --location 'host/api/auth/signup' --header 'X-Auth-Header: X_AUTH_HEADER' --header 'Content-Type: application/json' --data '{"username":"username","password":"password","is_superuser":true}'
Obtain access token
POST /api/auth/token
Payload
authentication.UserSerializer {
"username" : "username" ,
"password" : "password"
}
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
{"token":"token","user":{"username":"username","is_superuser":true}}
404
application/json
{"detail":"No User matches the given query."}
403
application/json
{"detail": "You must use authentication header"}
Example cURL
` curl --location 'host/api/auth/token' --header 'X-Auth-Header: X_AUTH_HEADER' --header 'Content-Type: application/json' --data '{"username":"username","password":"password"}' '
Recipe
Search for recipes
GET /api/recipe/home/
Parameters
name
type
data type
description
search
query (optional)
string
Part or fulll name of the recipe.Recipe object
page
query (optional)
int
Page number if there a mutilple pages result
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
{"count":int,"next":string,"previous":string,"results":[recipe.Recipe obj list]}
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'http://host:port/api/recipe/home/?name=name&page=1' --header ' X-Auth-Header: X_AUTH_HEADER
Get favorite recipes
GET /api/recipe/home/favorites/
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
{"count":int,"next":string,"previous":string,"results":[recipe.Recipe obj list]}
404
application/json
{"detail":"No Recipe matches the given query."}
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'http://host:port/api/recipe/home/favorites/' --header ' X-Auth-Header: X_AUTH_HEADER
Get trending recipes
GET /api/recipe/trending
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
[recipe.Recipe objects list]
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'localhost:8080/api/recipe/trending' --header ' X-Auth-Header: X_AUTH_HEADER
Update favorite status
PATCH /api/recipe/int:pk/favorite
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to be favorited or unfavorited
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Responses
http code
content-type
response
201
application/json
"Success favorite recipe"
201
application/json
"Success unfavorite recipe"
403
application/json
`{"detail":"You must use authentication header"}
404
application/json
Not Found
Example cURL
curl --location --request PATCH 'host/api/recipe/1/favorite' --header 'X-Auth-Header: X_AUTH_HEADER'
Create recipe
POST /api/recipe/
Payload
recipe.Recipe object {
"image" : f ile ,
"name" : s tr i n g ,
"serves" : i nt ,
"video" : f ile (op t io nal ) ,
"category" : <i nt : pk> ,
"tag" : <i nt : pk> ,
"prep_time" : i nt ,
}
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Content-Type
multipart/form-data
Recipe object
Recipe multipart/form-data object
Responses
http code
content-type
response
201
application/json
{recipe.Recipe object}
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'localhost:8080/api/recipe/' --header 'Authorization: Token d8916a5f6cf16d2c6a87bc7461bc4680245609f0' --form 'image=@"/path/image.jpg"' --form 'name="Test recipe creation"' --form 'serves="5"' --form 'category="1"' --form 'tag=1' --form 'prep_time="45"'
Update recipe main info (without ingredients and steps)
PUT /api/recipe/int:pk
Payload
recipe.Recipe object {
"image" : f ile ,
"name" : s tr i n g ,
"serves" : i nt ,
"video" : f ile (op t io nal ) ,
"category" : <i nt : pk> ,
"tag" : <i nt : pk> ,
"prep_time" : i nt ,
}
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to be updated
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Content-Type
multipart/form-data
Recipe object
Recipe multipart/form-data object
Responses
http code
content-type
response
200
application/json
{recipe.Recipe object}
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location --request PUT 'host/api/recipe/1' --header 'Authorization: Token d8916a5f6cf16d2c6a87bc7461bc4680245609f0' --form 'image=@"/path/image.jpg"' --form 'name="Update name"' --form 'serves="4"' --form 'category="1"' --form 'tag="1"' --form 'prep_time="21"'
Delete recipes
DELETE /api/recipe/pk:int/
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to be deleted
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Responses
http code
content-type
response
204
application/json
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location --request DELETE 'host/api/recipe/<int:pk>/' --header 'Authorization: Token d8916a5f6cf16d2c6a87bc7461bc4680245609f0'
Category
Get all categories
GET /api/recipe/category
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
[recipe.Category objects list]
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'host/api/recipe/category' --header 'X-Auth-Header: X_AUTH_HEADER'
Get all categories recipes
GET /api/recipe/category/int:pk/recipes
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Category primary key
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
[recipe.Recipe objects list]
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'host/api/recipe/category/1/recipes' --header 'X-Auth-Header: X_AUTH_HEADER'
Create category
POST /api/recipe/category/add
Payload
recipe.Category object {
"name" : s tr i n g
}
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
201
application/json
{recipe.Category object}
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'host/api/recipe/category/add' --header 'Authorization: token 443c104be8c6daeeaf86df634e69b97668b99900' --data '{"name":"Greek"}'
Update category
PUT /api/recipe/category/int:pk
Payload
recipe.Category object {
"name" : s tr i n g ,
}
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Category primary key
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
200
application/json
{recipe.Recipe object}
401
application/json
{"detail":"Authentication credentials were not provided."}
404
application/json
{"detail":"No Category matches the given query."}
Example cURL
curl --location --request PUT 'host/api/recipe/category/6' --header 'Authorization: token 443c104be8c6daeeaf86df634e69b97668b99900' --header 'Content-Type: application/json' --data '{"name":"Italiano"}'
Tag
GET /api/recipe/tags
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
[recipe.Tag objects list]
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'host/api/recipe/tags' --header 'X-Auth-Header: X_AUTH_HEADER'
Get all recipes from tag
GET /api/recipe/tag/int:pk/recipes
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Tag primary key
name
type
data type
description
X-Auth-Header
required
UUID
Header used for authentication with the API
Responses
http code
content-type
response
200
application/json
{"count":int,"next":string,"previous":string,"results":[recipe.Recipe obj list]}
403
application/json
{"detail":"You must use authentication header"}
Example cURL
curl --location 'host/api/recipe/tag/<int:pk>/recipes' --header 'X-Auth-Header: X_AUTH_HEADER'
Create tag
POST /api/recipe/tag/add
Payload
recipe.Tag object {
"name" : s tr i n g
}
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
201
application/json
{recipe.Category object}
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'host/api/recipe/tag/add' --header 'Authorization: token 443c104be8c6daeeaf86df634e69b97668b99900' --data '{"name":"Summer vibes"}'
Update tag
PUT /api/recipe/tag/int:pk
Payload
recipe.Category object {
"name" : s tr i n g ,
}
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Tag primary key
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
200
application/json
{recipe.Tag object}
401
application/json
{"detail":"Authentication credentials were not provided."}
404
application/json
{"detail":"No Category matches the given query."}
Example cURL
curl --location --request PUT 'host/api/recipe/tag/1' --header 'Authorization: token 443c104be8c6daeeaf86df634e69b97668b99900' --header 'Content-Type: application/json' --data '{"name":"Summer Vibes"}'
Ingredients
POST /api/recipe/int:pk/ingredients
Info
Override already existing ingredients for the recipe
Payload
recipe.Igredient object list [
{
"name" : "string,
" qua nt i t y ": string,
" me tr ic ": " s tr i n g
},
{
"name" : "string,
" qua nt i t y ": string,
" me tr ic ": " s tr i n g
},
....
]
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to which to link the ingredients
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
201
application/json
[{recipe.Ingrediant object}]
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'host/api/recipe/ingredients' --header 'Authorization: token 443c104be8c6daeeaf86df634e69b97668b99900' --data '[{"name":"Kasher salt","quantity":"1/5","metric":"tbsp","recipe":24}]'
Steps
POST /api/recipe/int:pk/steps
Info
Override already existing steps for the recipe
Payload
recipe.Step object list [
{
"text" : s tr i n g
},
{
"text" : s tr i n g
},
....
]
Parameters
name
type
data type
description
<int:pk>
path (required)
int
Recipe primary key to which to link the steps
name
type
data type
description
Authorization
required
Access Token
Token obtained from login endpoint example "token 443c104be8c6daeeaf86df634e69b97668b99900"
Content-Type
application/json
`Applicaton Json content header
Responses
http code
content-type
response
201
application/json
[{recipe.Step object}]
400
application/json
{"tag":["Incorrect type. message"]}
401
application/json
{"detail":"Authentication credentials were not provided."}
Example cURL
curl --location 'host/api/recipe/ingredients' --header 'Authorization: token 443c104be8c6daeeaf86df634e69b97668b99900' --data '[{"text":"Heat the oven","recipe":1}]'