Answer Recipe Allergen Rows
Records a person's answers for one or more allergen rows of the recipe and returns the updated record. Each item names an allergen code and a state: contains (with species where the list requires one), not_present, or not_answered to clear the person's answer. Saves one new version for all of them, or nothing when every answer is already stored.
A row an ingredient declares contains cannot be answered not_present, and an allergen on the cross-contact list cannot be answered contains. The answers are saved together or not at all. Send the recipe's current version_id in the If-Match header. Changing an answer makes an earlier confirmation of the record stale.
recipe_id*Recipe IdIf-Match*stringThe recipe's current version_id: the one the last change to this recipe returned, or the one reading the recipe returns (get_recipe). A stale value is refused with the current version_id; read the recipe again and retry.
application/json- body
Answers for one or more allergen rows.
items*array<>One answer per allergen, each naming a different code.
1 <= items <= 32Successful Response
application/json- response
The envelope for reading and changing a recipe's allergen record.
data*The allergen record of one recipe version.
meta*Response metadata.
version_id?|The version the record was read at; pass it as If-Match on the next change. Null only for a recipe that was never versioned.
curl -X PATCH 'https://api.bettermenu.live/studio/recipes/string/allergens/rows' \ -H 'If-Match: string' \ -H 'Content-Type: application/json' \ -d '{ "items": [ { "code": "string", "state": "contains" } ]}'{ "data": { "country": "US", "list_version": "string", "rows": [ { "code": "string", "state": "contains", "species": [ "string" ], "other_species": [ "string" ], "sources": [ { "kind": "custom_ingredient", "ingredient_row_id": "string", "custom_ingredient_id": "string", "custom_ingredient_version_id": "string", "name": "string", "via": [ "string" ], "actor": { "type": "member", "id": "string" }, "channel": "studio", "at": "2019-08-24T14:15:22Z" } ], "carried_state": "contains", "carried_species": [ "string" ], "carried_other_species": [ "string" ], "person": { "state": "contains", "species": [ "string" ], "other_species": [ "string" ], "actor": { "type": "member", "id": "string" }, "channel": "studio", "at": "2019-08-24T14:15:22Z" }, "person_answer_superseded": false, "name": "string" } ], "cross_contact": [ { "code": "string", "sources": [ { "kind": "custom_ingredient", "ingredient_row_id": "string", "custom_ingredient_id": "string", "custom_ingredient_version_id": "string", "name": "string", "via": [ "string" ], "actor": { "type": "member", "id": "string" }, "channel": "studio", "at": "2019-08-24T14:15:22Z" } ] } ], "unanswered": [ "string" ], "unreadable_ingredient_rows": [ "string" ], "complete": true, "record_hash": "string", "confirmation": { "state": "confirmed", "current": { "confirmation_id": "string", "version_id": "string", "record_hash": "string", "actor": { "type": "member", "id": "string" }, "channel": "studio", "confirmed_at": "2019-08-24T14:15:22Z" } } }, "meta": { "version": "string", "request_id": "string", "timestamp": "string" }, "version_id": "string"}