Replace a reusable meal
const url = 'http://127.0.0.1:8080/api/v1/saved-meals/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"dishes":[{"display_name":"example","entry_id":"example","id":"example","leftover_of":"example","notes":"example","plain_items":[{"id":"example","name":"example","quantity":"example"}],"recipe_revision":1,"scale":"example"}],"name":"example","notes":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url http://127.0.0.1:8080/api/v1/saved-meals/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "dishes": [ { "display_name": "example", "entry_id": "example", "id": "example", "leftover_of": "example", "notes": "example", "plain_items": [ { "id": "example", "name": "example", "quantity": "example" } ], "recipe_revision": 1, "scale": "example" } ], "name": "example", "notes": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”The current response body revision in double quotes, such as “4”. Do not use the GET response ETag or put revision in the body.
The current response body revision in double quotes, such as “4”. Do not use the GET response ETag or put revision in the body.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
A recipe dish named exactly as its recipe takes the recipe’s new title when the recipe is renamed.
Source dish ID for leftovers. Omit entry_id on this dish to avoid repeating the recipe requirement.
Only for a dish without entry_id.
object
Positive rational string multiplying the recipe quantities, such as 1/2 for half a batch. This is not a serving count.
Responses
Section titled “Responses”OK
object
object
A recipe dish named exactly as its recipe takes the recipe’s new title when the recipe is renamed.
Source dish ID for leftovers. Omit entry_id on this dish to avoid repeating the recipe requirement.
Only for a dish without entry_id.
object
Positive rational string multiplying the recipe quantities, such as 1/2 for half a batch. This is not a serving count.
Example
{ "dishes": [ { "recipe_status": "available" } ]}Headers
Section titled “Headers”Validates this representation, including the recipe details it reads. If-Match takes the revision instead.
Bad Request
object
Stable application error code; clients may also use the problem type suffix.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Structured context for the stable error code.
object
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
object
object
Example
{ "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}No valid session or API token (authentication-required), or the credential sent is invalid (invalid-credentials).
object
Example generated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}Not Found
object
Stable application error code; clients may also use the problem type suffix.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Structured context for the stable error code.
object
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
object
object
Example
{ "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}Precondition Failed
object
Stable application error code; clients may also use the problem type suffix.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Structured context for the stable error code.
object
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
object
object
Example
{ "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}Unprocessable Entity
object
Stable application error code; clients may also use the problem type suffix.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Structured context for the stable error code.
object
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
object
object
Example
{ "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}Precondition Required
object
Stable application error code; clients may also use the problem type suffix.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Structured context for the stable error code.
object
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
object
object
Example
{ "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}Internal Server Error
object
Stable application error code; clients may also use the problem type suffix.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Structured context for the stable error code.
object
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
object
object
Example
{ "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}