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
Authentication¶
Create admin user¶
POST /api/auth/signup
Payload¶
{
"username": "username",
"password": "password",
"email": "email",
"is_superuser": true
}
Headers¶
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¶
Obtain access token¶
POST /api/auth/token
Payload¶
Headers¶
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¶
Get user profile info¶
GET /api/auth/user/info
Headers¶
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¶
Change user password¶
PUT /api/auth/user
Payload¶
Headers¶
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¶
Update user email and username¶
PATCH /api/auth/user
Info
Individual fields can be updated only username or password.
Payload¶
Headers¶
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¶
Delete user account¶
DELETE /api/auth/delete-account
Headers¶
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¶
Request password reset token for user account¶
POST /api/auth/password_reset
Payload¶
Headers¶
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¶
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¶
Responses¶
http code | content-type | response |
---|---|---|
204 |
application/json |
No Content |
404 |
application/json |
{"detail":"No PasswordResetToken matches the given query."}} |
Example cURL¶
User Settings¶
Get User settings¶
GET /api/auth/settings/
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
{auth.models.UserSettingsSerializer} |
403 |
application/json |
{"detail":"You must use authentication header"} |
Example cURL¶
Update user settings¶
PATCH /api/auth/settings/
Payload¶
Languages choices (LANGUAGES_CHOICES)¶
('English', 'English'),
('Spanish', 'Español'),
('French', 'Français'),
('German', 'Deutsch'),
('Chinese', '中文'),
('Russian', 'Русский'),
('Italian', 'Italiano'),
('Japanese', '日本語'),
('Dutch', 'Nederlands'),
('Polish', 'Polski'),
('Greek', 'Ελληνικά'),
('Swedish', 'Svenska'),
('Czech', 'Čeština'),
('Bulgarian', 'Български'),
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
201 |
application/json |
{auth.models.UserSettingsSerializer} |
403 |
application/json |
{"detail":"You must use authentication header"} |
Example cURL¶
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 |
Headers¶
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¶
Get favorite recipes¶
GET /api/recipe/home/favorites/
Headers¶
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¶
Get trending recipes¶
GET /api/recipe/trending
Headers¶
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¶
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 |
Headers¶
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¶
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 |
Headers¶
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¶
Get recipe by pk¶
GET /api/recipe/int:pk/
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 object} |
403 |
application/json |
{"detail":"You must use authentication header"} |
404 |
application/json |
{"detail":"No Recipe matches the given query."} |
Example cURL¶
Create recipe¶
POST /api/recipe/
Payload¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int
}
Dificulty choices (DIFFICULTY_CHOICES)¶
('Easy', 'Easy'),
('Intermediate', 'Intermediate'),
('Advanced', 'Advanced'),
('Expert', 'Expert'),
Headers¶
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¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int,
"clear_video": boolean (optional if you want to delete already set video)
}
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 |
Headers¶
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¶
Scrape recipes¶
POST /api/recipe/scrape
Info
Valid OpenAI API Key is nedded for this endpoint
Payload¶
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
{recipe.Recipe object} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Generate recipes¶
POST /api/recipe/generate
Info
Valid OpenAI API Key is nedded for this endpoint
Payload¶
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
[GenerateRecipeResultSerializer objects] |
204 |
application/json |
{Empty response if there a openai empty response} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Translate recipe¶
POST /api/recipe/translate
Payload¶
Language choices (LANGUAGES_CHOICES)¶
('English', 'English'),
('Spanish', 'Español'),
('French', 'Français'),
('German', 'Deutsch'),
('Chinese', '中文'),
('Russian', 'Русский'),
('Italian', 'Italiano'),
('Japanese', '日本語'),
('Dutch', 'Nederlands'),
('Polish', 'Polski'),
('Greek', 'Ελληνικά'),
('Swedish', 'Svenska'),
('Czech', 'Čeština'),
('Bulgarian', 'Български'),
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
{recipe.Recipe object} |
400 |
application/json |
{"errors":["Default language for translation should be set"]} |
400 |
application/json |
{"errors":["Translation must be performed only on original recipes"]} |
400 |
application/json |
{"errors":["Translation language is already used and there a recipe translated with that language."]} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Get recipe variations (translation)¶
GET /api/recipe/int:pk/variations
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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.serializers.TranslateRecipeSerializer object} |
403 |
application/json |
{"detail":"You must use authentication header"} |
404 |
application/json |
{"detail":"No Recipe matches the given query."} |
Example cURL¶
Schedule (Meal Planner)¶
Get Schedule¶
GET /api/schedule/
Parameters¶
name | type | data type | description |
---|---|---|---|
date |
path (required) |
int |
Schedule date eg. 2025-1-26 |
Headers¶
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 |
[schedule.ScheduleRepresentationSerializer objects list] |
403 |
application/json |
{"detail":"You must use authentication header"} |
Example cURL¶
Create schedule¶
POST /api/schedule/
Payload¶
{
"timing": schedule.models.TIMING_CHOICES,
"recipe": recipe.pk,
"date": date-format-YYYY-MM-DD
}
Headers¶
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 |
{schedule.ScheduleRepresentationSerializer object} |
400 |
application/json |
{"error": "Invalid date format. Use YYYY-MM-DD."} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Delete schedule¶
DELETE /api/schedule/
##### Parameters
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Schedule pk |
Headers¶
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¶
Category¶
Get all categories¶
GET /api/recipe/category
Headers¶
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¶
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 |
Headers¶
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¶
Create category¶
POST /api/recipe/category/add
Payload¶
Headers¶
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¶
Update category¶
PUT /api/recipe/category/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Category primary key |
Headers¶
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¶
Tag¶
Get all tags¶
GET /api/recipe/tags
Headers¶
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¶
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 |
Headers¶
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¶
Create tag¶
POST /api/recipe/tag/add
Payload¶
Headers¶
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¶
Update tag¶
PUT /api/recipe/tag/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Tag primary key |
Headers¶
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¶
Ingredients¶
POST /api/recipe/int:pk/ingredients
Info
Override already existing ingredients for the recipe
Payload¶
[
{
"name": "string,
"quantity": string,
"metric": "string
},
{
"name": "string,
"quantity": string,
"metric": "string
},
....
]
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the ingredients |
Headers¶
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¶
Steps¶
POST /api/recipe/int:pk/steps
Info
Override already existing steps for the recipe
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the steps |
Headers¶
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¶
Authentication¶
Create admin user¶
POST /api/auth/signup
Payload¶
{
"username": "username",
"password": "password",
"email": "email",
"is_superuser": true
}
Headers¶
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¶
Obtain access token¶
POST /api/auth/token
Payload¶
Headers¶
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¶
Get user profile info¶
GET /api/auth/user/info
Headers¶
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¶
Change user password¶
PUT /api/auth/user
Payload¶
Headers¶
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¶
Update user email and username¶
PATCH /api/auth/user
Info
Individual fields can be updated only username or password.
Payload¶
Headers¶
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¶
Delete user account¶
DELETE /api/auth/delete-account
Headers¶
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¶
Request password reset token for user account¶
POST /api/auth/password_reset
Payload¶
Headers¶
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¶
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¶
Responses¶
http code | content-type | response |
---|---|---|
204 |
application/json |
No Content |
404 |
application/json |
{"detail":"No PasswordResetToken matches the given query."}} |
Example cURL¶
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 |
Headers¶
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¶
Get favorite recipes¶
GET /api/recipe/home/favorites/
Headers¶
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¶
Get trending recipes¶
GET /api/recipe/trending
Headers¶
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¶
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 |
Headers¶
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¶
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 |
Headers¶
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¶
Get recipe by pk¶
GET /api/recipe/int:pk/
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 object} |
403 |
application/json |
{"detail":"You must use authentication header"} |
404 |
application/json |
{"detail":"No Recipe matches the given query."} |
Example cURL¶
Create recipe¶
POST /api/recipe/
Payload¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int
}
Dificulty choices (DIFFICULTY_CHOICES)¶
('Easy', 'Easy'),
('Intermediate', 'Intermediate'),
('Advanced', 'Advanced'),
('Expert', 'Expert'),
Headers¶
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¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int,
"clear_video": boolean (optional if you want to delete already set video)
}
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 |
Headers¶
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¶
Scrape recipes¶
POST /api/recipe/scrape
Info
Valid OpenAI API Key is nedded for this endpoint
Payload¶
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
{recipe.Recipe object} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Generate recipes¶
POST /api/recipe/generate
Info
Valid OpenAI API Key is nedded for this endpoint
Payload¶
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
[GenerateRecipeResultSerializer objects] |
204 |
application/json |
{Empty response if there a openai empty response} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Schedule (Meal Planner)¶
Get Schedule¶
GET /api/schedule/
Parameters¶
name | type | data type | description |
---|---|---|---|
date |
path (required) |
int |
Schedule date eg. 2025-1-26 |
Headers¶
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 |
[schedule.ScheduleRepresentationSerializer objects list] |
403 |
application/json |
{"detail":"You must use authentication header"} |
Example cURL¶
Create schedule¶
POST /api/schedule/
Payload¶
{
"timing": schedule.models.TIMING_CHOICES,
"recipe": recipe.pk,
"date": date-format-YYYY-MM-DD
}
Headers¶
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 |
{schedule.ScheduleRepresentationSerializer object} |
400 |
application/json |
{"error": "Invalid date format. Use YYYY-MM-DD."} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Delete schedule¶
DELETE /api/schedule/
##### Parameters
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Schedule pk |
Headers¶
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¶
Category¶
Get all categories¶
GET /api/recipe/category
Headers¶
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¶
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 |
Headers¶
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¶
Create category¶
POST /api/recipe/category/add
Payload¶
Headers¶
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¶
Update category¶
PUT /api/recipe/category/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Category primary key |
Headers¶
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¶
Tag¶
Get all tags¶
GET /api/recipe/tags
Headers¶
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¶
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 |
Headers¶
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¶
Create tag¶
POST /api/recipe/tag/add
Payload¶
Headers¶
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¶
Update tag¶
PUT /api/recipe/tag/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Tag primary key |
Headers¶
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¶
Ingredients¶
POST /api/recipe/int:pk/ingredients
Info
Override already existing ingredients for the recipe
Payload¶
[
{
"name": "string,
"quantity": string,
"metric": "string
},
{
"name": "string,
"quantity": string,
"metric": "string
},
....
]
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the ingredients |
Headers¶
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¶
Steps¶
POST /api/recipe/int:pk/steps
Info
Override already existing steps for the recipe
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the steps |
Headers¶
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¶
Authentication¶
Create admin user¶
POST /api/auth/signup
Payload¶
{
"username": "username",
"password": "password",
"email": "email",
"is_superuser": true
}
Headers¶
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¶
Obtain access token¶
POST /api/auth/token
Payload¶
Headers¶
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¶
Get user profile info¶
GET /api/auth/user/info
Headers¶
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¶
Change user password¶
PUT /api/auth/user
Payload¶
Headers¶
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¶
Update user email and username¶
PATCH /api/auth/user
Info
Individual fields can be updated only username or password.
Payload¶
Headers¶
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¶
Delete user account¶
DELETE /api/auth/delete-account
Headers¶
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¶
Request password reset token for user account¶
POST /api/auth/password_reset
Payload¶
Headers¶
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¶
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¶
Responses¶
http code | content-type | response |
---|---|---|
204 |
application/json |
No Content |
404 |
application/json |
{"detail":"No PasswordResetToken matches the given query."}} |
Example cURL¶
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 |
Headers¶
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¶
Get favorite recipes¶
GET /api/recipe/home/favorites/
Headers¶
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¶
Get trending recipes¶
GET /api/recipe/trending
Headers¶
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¶
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 |
Headers¶
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¶
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 |
Headers¶
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¶
Get recipe by pk¶
GET /api/recipe/int:pk/
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 object} |
403 |
application/json |
{"detail":"You must use authentication header"} |
404 |
application/json |
{"detail":"No Recipe matches the given query."} |
Example cURL¶
Create recipe¶
POST /api/recipe/
Payload¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int
}
Dificulty choices (DIFFICULTY_CHOICES)¶
('Easy', 'Easy'),
('Intermediate', 'Intermediate'),
('Advanced', 'Advanced'),
('Expert', 'Expert'),
Headers¶
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¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int,
"clear_video": boolean (optional if you want to delete already set video)
}
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 |
Headers¶
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¶
Scrape recipes¶
POST /api/recipe/scrape
Info
Valid OpenAI API Key is nedded for this endpoint
Payload¶
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
{recipe.Recipe object} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Generate recipes¶
POST /api/recipe/generate
Info
Valid OpenAI API Key is nedded for this endpoint
Payload¶
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
[GenerateRecipeResultSerializer objects] |
204 |
application/json |
{Empty response if there a openai empty response} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Category¶
Get all categories¶
GET /api/recipe/category
Headers¶
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¶
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 |
Headers¶
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¶
Create category¶
POST /api/recipe/category/add
Payload¶
Headers¶
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¶
Update category¶
PUT /api/recipe/category/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Category primary key |
Headers¶
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¶
Tag¶
Get all tags¶
GET /api/recipe/tags
Headers¶
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¶
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 |
Headers¶
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¶
Create tag¶
POST /api/recipe/tag/add
Payload¶
Headers¶
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¶
Update tag¶
PUT /api/recipe/tag/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Tag primary key |
Headers¶
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¶
Ingredients¶
POST /api/recipe/int:pk/ingredients
Info
Override already existing ingredients for the recipe
Payload¶
[
{
"name": "string,
"quantity": string,
"metric": "string
},
{
"name": "string,
"quantity": string,
"metric": "string
},
....
]
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the ingredients |
Headers¶
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¶
Steps¶
POST /api/recipe/int:pk/steps
Info
Override already existing steps for the recipe
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the steps |
Headers¶
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¶
Authentication¶
Create admin user¶
POST /api/auth/signup
Payload¶
{
"username": "username",
"password": "password",
"email": "email",
"is_superuser": true
}
Headers¶
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¶
Obtain access token¶
POST /api/auth/token
Payload¶
Headers¶
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¶
Get user profile info¶
GET /api/auth/user/info
Headers¶
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¶
Change user password¶
PUT /api/auth/user
Payload¶
Headers¶
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¶
Update user email and username¶
PATCH /api/auth/user
Info
Individual fields can be updated only username or password.
Payload¶
Headers¶
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¶
Delete user account¶
DELETE /api/auth/delete-account
Headers¶
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¶
Request password reset token for user account¶
POST /api/auth/password_reset
Payload¶
Headers¶
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¶
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¶
Responses¶
http code | content-type | response |
---|---|---|
204 |
application/json |
No Content |
404 |
application/json |
{"detail":"No PasswordResetToken matches the given query."}} |
Example cURL¶
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 |
Headers¶
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¶
Get favorite recipes¶
GET /api/recipe/home/favorites/
Headers¶
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¶
Get trending recipes¶
GET /api/recipe/trending
Headers¶
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¶
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 |
Headers¶
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¶
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 |
Headers¶
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¶
Get recipe by pk¶
GET /api/recipe/int:pk/
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 object} |
403 |
application/json |
{"detail":"You must use authentication header"} |
404 |
application/json |
{"detail":"No Recipe matches the given query."} |
Example cURL¶
Create recipe¶
POST /api/recipe/
Payload¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int
}
Dificulty choices (DIFFICULTY_CHOICES)¶
('Easy', 'Easy'),
('Intermediate', 'Intermediate'),
('Advanced', 'Advanced'),
('Expert', 'Expert'),
Headers¶
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¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int,
"clear_video": boolean (optional if you want to delete already set video)
}
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 |
Headers¶
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¶
Scrape recipes¶
POST /api/recipe/scrape
Info
Valid OpenAI API Key is nedded for this endpoint
Payload¶
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
{recipe.Recipe object} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Category¶
Get all categories¶
GET /api/recipe/category
Headers¶
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¶
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 |
Headers¶
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¶
Create category¶
POST /api/recipe/category/add
Payload¶
Headers¶
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¶
Update category¶
PUT /api/recipe/category/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Category primary key |
Headers¶
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¶
Tag¶
Get all tags¶
GET /api/recipe/tags
Headers¶
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¶
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 |
Headers¶
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¶
Create tag¶
POST /api/recipe/tag/add
Payload¶
Headers¶
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¶
Update tag¶
PUT /api/recipe/tag/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Tag primary key |
Headers¶
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¶
Ingredients¶
POST /api/recipe/int:pk/ingredients
Info
Override already existing ingredients for the recipe
Payload¶
[
{
"name": "string,
"quantity": string,
"metric": "string
},
{
"name": "string,
"quantity": string,
"metric": "string
},
....
]
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the ingredients |
Headers¶
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¶
Steps¶
POST /api/recipe/int:pk/steps
Info
Override already existing steps for the recipe
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the steps |
Headers¶
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¶
Authentication¶
Create admin user¶
POST /api/auth/signup
Payload¶
{
"username": "username",
"password": "password",
"email": "email",
"is_superuser": true
}
Headers¶
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¶
Obtain access token¶
POST /api/auth/token
Payload¶
Headers¶
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¶
Get user profile info¶
GET /api/auth/user/info
Headers¶
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¶
Change user password¶
PUT /api/auth/user
Payload¶
Headers¶
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¶
Update user email and username¶
PATCH /api/auth/user
Info
Individual fields can be updated only username or password.
Payload¶
Headers¶
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¶
Delete user account¶
DELETE /api/auth/delete-account
Headers¶
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¶
Request password reset token for user account¶
POST /api/auth/password_reset
Payload¶
Headers¶
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¶
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¶
Responses¶
http code | content-type | response |
---|---|---|
204 |
application/json |
No Content |
404 |
application/json |
{"detail":"No PasswordResetToken matches the given query."}} |
Example cURL¶
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 |
Headers¶
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¶
Get favorite recipes¶
GET /api/recipe/home/favorites/
Headers¶
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¶
Get trending recipes¶
GET /api/recipe/trending
Headers¶
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¶
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 |
Headers¶
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¶
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 |
Headers¶
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¶
Get recipe by pk¶
GET /api/recipe/int:pk/
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 object} |
403 |
application/json |
{"detail":"You must use authentication header"} |
404 |
application/json |
{"detail":"No Recipe matches the given query."} |
Example cURL¶
Create recipe¶
POST /api/recipe/
Payload¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int
}
Dificulty choices (DIFFICULTY_CHOICES)¶
('Easy', 'Easy'),
('Intermediate', 'Intermediate'),
('Advanced', 'Advanced'),
('Expert', 'Expert'),
Headers¶
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¶
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"category": <int:pk> (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int,
"clear_video": boolean (optional if you want to delete already set video)
}
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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 |
Headers¶
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¶
Category¶
Get all categories¶
GET /api/recipe/category
Headers¶
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¶
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 |
Headers¶
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¶
Create category¶
POST /api/recipe/category/add
Payload¶
Headers¶
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¶
Update category¶
PUT /api/recipe/category/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Category primary key |
Headers¶
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¶
Tag¶
Get all tags¶
GET /api/recipe/tags
Headers¶
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¶
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 |
Headers¶
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¶
Create tag¶
POST /api/recipe/tag/add
Payload¶
Headers¶
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¶
Update tag¶
PUT /api/recipe/tag/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Tag primary key |
Headers¶
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¶
Ingredients¶
POST /api/recipe/int:pk/ingredients
Info
Override already existing ingredients for the recipe
Payload¶
[
{
"name": "string,
"quantity": string,
"metric": "string
},
{
"name": "string,
"quantity": string,
"metric": "string
},
....
]
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the ingredients |
Headers¶
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¶
Steps¶
POST /api/recipe/int:pk/steps
Info
Override already existing steps for the recipe
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the steps |
Headers¶
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¶
Authentication¶
Create admin user¶
POST /api/auth/signup
Payload¶
{
"username": "username",
"password": "password",
"is_superuser": true
}
Headers¶
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¶
Obtain access token¶
POST /api/auth/token
Payload¶
Headers¶
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¶
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 |
Headers¶
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¶
Get favorite recipes¶
GET /api/recipe/home/favorites/
Headers¶
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¶
Get trending recipes¶
GET /api/recipe/trending
Headers¶
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¶
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 |
Headers¶
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¶
Create recipe¶
POST /api/recipe/
Payload¶
{
"image": file,
"name": string,
"serves": int,
"video": file (optional),
"category": <int:pk>,
"tag": <int:pk>,
"prep_time": int,
}
Headers¶
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¶
Update recipe main info (without ingredients and steps)¶
PUT /api/recipe/int:pk
Payload¶
{
"image": file,
"name": string,
"serves": int,
"video": file (optional),
"category": <int:pk>,
"tag": <int:pk>,
"prep_time": int,
}
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be updated |
Headers¶
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¶
Delete recipes¶
DELETE /api/recipe/pk:int/
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to be deleted |
Headers¶
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¶
Category¶
Get all categories¶
GET /api/recipe/category
Headers¶
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¶
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 |
Headers¶
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¶
Create category¶
POST /api/recipe/category/add
Payload¶
Headers¶
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¶
Update category¶
PUT /api/recipe/category/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Category primary key |
Headers¶
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¶
Tag¶
Get all tags¶
GET /api/recipe/tags
Headers¶
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¶
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 |
Headers¶
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¶
Create tag¶
POST /api/recipe/tag/add
Payload¶
Headers¶
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¶
Update tag¶
PUT /api/recipe/tag/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Tag primary key |
Headers¶
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¶
Ingredients¶
POST /api/recipe/int:pk/ingredients
Info
Override already existing ingredients for the recipe
Payload¶
[
{
"name": "string,
"quantity": string,
"metric": "string
},
{
"name": "string,
"quantity": string,
"metric": "string
},
....
]
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the ingredients |
Headers¶
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¶
Steps¶
POST /api/recipe/int:pk/steps
Info
Override already existing steps for the recipe
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key to which to link the steps |
Headers¶
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."} |