-
Notifications
You must be signed in to change notification settings - Fork 0
JSON interface
This page describes the JSON interface for the RememberRecipe android app. The API's address is https://recipe.dns-cloud.net/new/<command>.
The following commands are available:
| Command | Description |
|---|---|
new_set |
Initialize new dataset and create session_id for further operations. |
set_title |
Set title of recipe. |
get_available_tags |
Get list of known tags. They could be used for auto-completion. |
set_tags |
Set tags for recipe. |
set_rating |
Set rating for recipe. |
set_reference |
Set reference of recipe. E.g. book, page, ... |
get_available_ingredients |
Get list of known ingredients. They could be used for auto-completion. |
set_ingredients |
Set ingredients of recipe. |
add_photo |
Add a photo for this recipe. |
remove_photo |
Remove one of the saved photos. |
move_photo |
Change order of photos. |
read_back_data |
Read all data that is stored for the session_id including the photos. |
| Example URL | https://recipe.dns-cloud.net/new/new_set |
|---|---|
| Status 200 | Content-Type: application/json |
HTTP request type: GET
|
new_set initializes a new data set. It is necessary to call this function before any other. It responds with a session_id that must be used for all other commands.
No Attributes required.
The function returns the session_id.
| Attribute | Type | Description |
|---|---|---|
session_id |
integer |
The id for this session to use in further commands. |
| Example URL | https://recipe.dns-cloud.net/new/set_title |
|---|---|
| Status 200 | Content-Type: application/json |
HTTP request type: POST
|
set_title saves the title for the recipe.
| Attribute | Type | Appears | Description | Possible Values |
|---|---|---|---|---|
session_id |
integer |
always | The id for this session returned by new_set
|
The ID returned by new_set
|
title |
string |
always | The title for this recipe | any |
| Attribute | Type | Description |
|---|---|---|
status |
string |
Returns ok if ok or error message |
| Example URL | https://recipe.dns-cloud.net/new/get_available_tags |
|---|---|
| Status 200 | Content-Type: application/json |
HTTP request type: GET
|
Get available tags to be used for auto-completion in the tags edit box.
No parameters necessary
| Attribute | Type | Description |
|---|---|---|
tags |
array of string
|
Each array element is one tag |
| Example URL | https://recipe.dns-cloud.net/new/set_tags |
|---|---|
| Status 200 | Content-Type: application/json |
HTTP request type: POST
|
set_tags saves the tags for the recipe.
| Attribute | Type | Appears | Description | Possible Values |
|---|---|---|---|---|
session_id |
integer |
always | The id for this session returned by new_set
|
The ID returned by new_set
|
tags |
string |
always | The tags in a single string | any |
| Attribute | Type | Description |
|---|---|---|
status |
string |
Returns ok if ok or error message |
| Example URL | https://recipe.dns-cloud.net/new/set_rating |
|---|---|
| Status 200 | Content-Type: application/json |
HTTP request type: POST
|
set_rating saves the rating for the recipe.
| Attribute | Type | Appears | Description | Possible Values |
|---|---|---|---|---|
session_id |
integer |
always | The id for this session returned by new_set
|
The ID returned by new_set
|
rating |
integer |
always | The rating for the recipe |
0 to 5
|
| Attribute | Type | Description |
|---|---|---|
status |
string |
Returns ok if ok or error message |
| Example URL | https://recipe.dns-cloud.net/new/set_reference |
|---|---|
| Status 200 | Content-Type: application/json |
HTTP request type: POST
|
set_reference saves the reference, i.e. cooking book, page, for the recipe.
| Attribute | Type | Appears | Description | Possible Values |
|---|---|---|---|---|
session_id |
integer |
always | The id for this session returned by new_set
|
The ID returned by new_set
|
reference |
string |
always | The reference in a single string | any |
| Attribute | Type | Description |
|---|---|---|
status |
string |
Returns ok if ok or error message |
| Example URL | https://recipe.dns-cloud.net/new/get_available_ingredients |
|---|---|
| Status 200 | Content-Type: application/json |
HTTP request type: GET
|
Get available ingredients to be used for auto-completion in the ingredients edit box.
No parameters necessary
| Attribute | Type | Description |
|---|---|---|
ingredients |
array of string
|
Each array element is one known ingredient |
| Example URL | https://recipe.dns-cloud.net/new/set_ingredients |
|---|---|
| Status 200 | Content-Type: application/json |
HTTP request type: POST
|
set_ingredients saves the ingredients for the recipe.
| Attribute | Type | Appears | Description | Possible Values |
|---|---|---|---|---|
session_id |
integer |
always | The id for this session returned by new_set
|
The ID returned by new_set
|
ingredients |
string |
always | The ingredients in a single string | any |
| Attribute | Type | Description |
|---|---|---|
status |
string |
Returns ok if ok or error message |
| Example URL | https://recipe.dns-cloud.net/new/add_photo |
|---|---|
| Status 200 | Content-Type: application/json |
HTTP request type: POST
|
add_photo saves a photo for the recipe.
| Attribute | Type | Appears | Description | Possible Values |
|---|---|---|---|---|
session_id |
integer |
always | The id for this session returned by new_set
|
The ID returned by new_set
|
photodata |
string |
always | The binary photo data converted into base64. Only JPEG is supported at the moment | any |
| Attribute | Type | Description |
|---|---|---|
status |
string |
Returns ok if ok or error message |
TBD
TBD
TBD