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¶
authentication.UserSerializer
{
"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¶
auth.serializers.UserSettingsSerializer object
{
"preferred_translate_language": LANGUAGES_CHOICES,
"compact_pdf": bool,
"emoji_recipes": bool
}
Languages choices (LANGUAGES_CHOICES)¶
recipe.models.LANGUAGES_CHOICES (use only the key in the request)
('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¶
recipe.Recipe object
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (optional),
"tag": <int:pk> (optional),
"prep_time": int,
"cook_time": int
}
Dificulty choices (DIFFICULTY_CHOICES)¶
recipe.models.DIFFICULTY_CHOICES (use only the key in the request)
('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¶
recipe.Recipe object
{
"image": file,
"name": string,
"serves": int,
"description": string,
"difficulty": string (DIFFICULTY_CHOICES),
"chef": string
"video": file (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"'
Update Recipe Category¶
PATCH /api/recipe/int:pk/category
##### Payload
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Recipe primary key |
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
204 |
application/json |
`` |
403 |
application/json |
{"detail": "Authentication credentials were not provided."} |
404 |
application/json |
{"detail": "No Recipe matches the given query."]} |
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 |
Responses¶
http code | content-type | response |
---|---|---|
204 |
application/json |
|
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¶
Get recipe variations (translation)¶
GET /api/recipe/random
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.RecipePreviewSerializer object} |
403 |
application/json |
{"detail":"You must use authentication header"} |
Example cURL¶
Recipe OpenAI¶
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
Info
Valid OpenAI API Key is nedded for this endpoint
Payload¶
Language choices (LANGUAGES_CHOICES)¶
recipe.models.LANGUAGES_CHOICES (use only the key in the request)
('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¶
Generate recipe audio¶
POST /api/recipe/audio
Info
Valid OpenAI API Key is nedded for this endpoint. Current model used is tts-4o-mini that translate English language good and struggle for other languages.
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.AudioInstructionsSerializer object} |
400 |
application/json |
{"errors":["Recipe is converted to audio instructions already"]} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
404 |
application/json |
{"errors":["Recipe with that pk does not exists"]} |
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¶
recipe.Igredient object list
[
{
"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¶
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¶
recipe.Category object
{
"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¶
Shopping (Shopping List)¶
Get Shopping lists¶
GET /api/shopping/
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.ShoppingList objects list] |
403 |
application/json |
{"detail":"You must use authentication header"} |
Example cURL¶
Get Shopping list (single)¶
GET /api/shopping/single/int:pk/
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.ShoppingList object] |
403 |
application/json |
{"detail":"You must use authentication header"} |
Example cURL¶
Create shopping¶
POST /api/shopping/
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 |
{schedule.SingleShoppingListSerializer object} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Update Schopping List¶
PUT /api/shopping/int:pk
Payload¶
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Shopping list 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.ShoppingList object} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
404 |
application/json |
{"detail":"No ShoppingList matches the given query."} |
Example cURL¶
Complete Shopping List¶
PATCH /api/shopping/complete-list/int:pk/
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Shopping list primary key |
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 complete shopping list"} |
201 |
application/json |
{"Success incomplete shopping list"} |
403 |
application/json |
{"detail": "Authentication credentials were not provided."} |
404 |
application/json |
{"detail": "No ShoppingList matches the given query."]} |
Example cURL¶
Delete Shopping List¶
DELETE /api/shopping/int:pk/
##### Parameters
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Shopping list primary key |
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."} |
404 |
application/json |
{"detail": "No ShoppingList matches the given query."} |
Example cURL¶
Add Item to Shopping List¶
PATCH /api/shopping/single/int:pk/
Payload¶
shopping.ShoppingItemPatchSerializer partial object
{
"name": string,
"quantity": string,
"metric": string
}
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Shopping list primary key |
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
201 |
application/json |
{shopping.ShoppingItemSerializer object} |
403 |
application/json |
{"detail": "Authentication credentials were not provided."} |
404 |
application/json |
{"detail": "No ShoppingList matches the given query."]} |
Example cURL¶
Update Item in Shopping List¶
PATCH /api/shopping/item/int:pk/
Payload¶
shopping.ShoppingItemPatchSerializer partial object
{
"name": string,
"quantity": string,
"metric": string
}
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Shopping list Item primary key |
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
{shopping.ShoppingItemSerializer object} |
403 |
application/json |
{"detail": "Authentication credentials were not provided."} |
404 |
application/json |
{"detail": "No ShoppingList matches the given query."]} |
Example cURL¶
Complete Item in Shopping List¶
PATCH /api/shopping/item/int:pk/complete/
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Shopping list Item primary key |
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 completed item"} |
201 |
application/json |
{"Success incompleted item"} |
403 |
application/json |
{"detail": "Authentication credentials were not provided."} |
404 |
application/json |
{"detail": "No ShoppingItem matches the given query."]} |
Example cURL¶
Delete Shopping List Item¶
DELETE /api/shopping/item/int:pk/
##### Parameters
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
Shopping list item primary key |
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."} |
404 |
application/json |
{"detail": "No ShoppingItem matches the given query."} |
Example cURL¶
Backupper (backup database)¶
Create backup¶
POST /api/backupper/
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
201 |
application/json |
Successfully created backup file: backups/file.zip |
403 |
application/json |
{"detail": "Authentication credentials were not provided."} |
Example cURL¶
Get all backups¶
GET /api/backupper/
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
[BackupSnapshotSerializer objects] |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Get single backups¶
GET /api/backupper/int:pk/
Parameters¶
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
BackupSnapshot.pk |
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
200 |
application/json |
{BackupSnapshotSerializer object} |
401 |
application/json |
{"detail":"Authentication credentials were not provided."} |
Example cURL¶
Apply backup¶
PATCH /api/backupper/
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 |
{"Successfully loaded backup file: backups/file.zip} |
403 |
application/json |
{"detail": "Authentication credentials were not provided."} |
404 |
application/json |
{"detail": "No BackupSnapshot matches the given query."} |
Example cURL¶
Import backup¶
POST /api/backupper/import/
Headers¶
name | type | data type | description |
---|---|---|---|
Authorization |
required |
Access Token |
Token obtained from login endpoint |
Responses¶
http code | content-type | response |
---|---|---|
201 |
application/json |
File uploaded successfully |
403 |
application/json |
{"detail": "Authentication credentials were not provided."} |
Example cURL¶
Delete backup¶
DELETE /api/backupper/int:pk/
##### Parameters
name | type | data type | description |
---|---|---|---|
<int:pk> |
path (required) |
int |
BackupSnapshot.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."} |
404 |
application/json |
{"detail": "No BackupSnapshot matches the given query."} |