Full replace of the documents attached to one chapter of the specification. Files are uploaded beforehand through the document API and referenced by id. An id the list does not carry is detached (the file itself stays in the document API); an id it carries that is not attached yet is attached; [] detaches them all.
Anyone who can update the specification may change its documents, on the retailer side or the supplier side.
Refused with a 422 naming fileIds: an unknown file; a file owned by a company other than the specification's owner or supplier; a file type the chapter does not accept; a file already attached to another chapter of the specification (detach it there first); the same file twice; a file sent for a chapterType the specification does not have. A locked specification is a 422 INVALID_RESOURCE_STATE with no paramName.
Nothing to change is a no-op (204): the list the chapter already carries, also on a locked specification, and [] for a chapterType the specification does not have.
Read the result back on the chapter's documents.
- Productionhttps://apis.traceone.com/spec/v2/food/specifications/{specificationId}/chapters/{chapterType}/documents
curl -i -X PUT \
'https://apis.traceone.com/spec/v2/food/specifications/{specificationId}/chapters/{chapterType}/documents' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"fileIds": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}'