Confirm Recipe Allergens
Records that a person reviewed the recipe's allergen record and stands behind it. Send the record_hash of the record the person was shown and the recipe's current version_id as If-Match.
Refused while any row is not_answered or an ingredient's version could not be read (422 allergens_not_confirmable, with reason, codes and ingredient_rows), when the record changed since it was read (409 allergens_record_changed, with the current record_hash), or when the recipe changed since If-Match. The confirmation is kept outside the recipe's versions with its history; a later change to an answer, the ingredients or the allergen list makes it stale. Confirming the record that is already confirmed records nothing new (created: false).
A confirmation is the person's attestation, so it is refused when the request comes from an agent (403 channel_not_permitted): the person confirms in Studio or through the API.
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
The fingerprint of the record the person reviewed.
record_hash*Record Hashrecord_hash of the record the person was shown.
^[0-9a-f]{64}$Successful Response
application/json- response
The confirmed record, with whether this request recorded a confirmation.
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.
created*CreatedFalse when the same record at the same version was already confirmed and nothing new was recorded.
curl -X POST 'https://api.bettermenu.live/studio/recipes/string/allergens/confirm' \ -H 'If-Match: string' \ -H 'Content-Type: application/json' \ -d '{ "record_hash": "string"}'{ "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", "created": true}