Attach Recipe Protein Quality Document
Attach a document (lab report, supplier sheet) to the protein quality value.
Optional: a value with no document is accepted. The document is stored once by its SHA-256 and the value points at it, so attaching another one commits a new version and earlier versions keep theirs.
Send If-Match with the recipe's current version_id: a missing one
is refused with 412, a stale one with 409.
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
A document supporting the protein quality value, sent inline.
file_name*File NameThe document's file name.
1 <= length <= 255content_type*ProteinQualityDocumentTypeThe document's media type: PDF, PNG or JPEG.
"application/pdf""image/png""image/jpeg"content_base64*Content Base64The document's bytes, base64-encoded; at most 4194304 bytes once decoded.
1 <= lengthSuccessful Response
application/json- response
Standard response envelope.
data*The recipe's protein quality value, claim and display choice.
meta*Response metadata.
version_id?|Version committed for this mutation; pass on the next request as If-Match for optimistic concurrency. Present only on versions declaring the recipe_versioning capability.
curl -X PUT 'https://api.bettermenu.live/studio/recipes/string/protein-quality/document' \ -H 'If-Match: string' \ -H 'Content-Type: application/json' \ -d '{ "file_name": "string", "content_type": "application/pdf", "content_base64": "string"}'{ "data": { "recipe_id": "string", "quality": { "method": "pdcaas", "score": "string", "source": "lab_finished_product", "basis_note": "string", "entered_by": "string", "entered_at": "2019-08-24T14:15:22Z", "document": { "sha256": "string", "file_name": "string", "content_type": "string", "size_bytes": 0, "uploaded_by": "string", "uploaded_at": "2019-08-24T14:15:22Z", "download_url": "string" } }, "claim": "none", "low_score_display": "percent_dv", "main_protein_source": { "ingredient_name": "string", "share": "string" }, "ingredients_changed_since_entered": true, "check_facts": {} }, "meta": { "version": "string", "request_id": "string", "timestamp": "string" }, "version_id": "string"}