Full replace of the requirements attached to one chapter of the specification. Requirements are PRE-CREATED library objects of the specification's owner company, referenced by id. An id the list does not carry is detached; an id it carries that is not attached yet is attached; [] detaches them all. Removals are applied before additions, so replacing a requirement by its new version works in one call.
Only a retailer contact of the specification may change its requirements; anyone else is a 403.
Refused with a 422 naming requirementIds: an unknown id; a requirement of another company; a requirement that is not its active version; a requirement already attached to another chapter of the specification (detach it there first); the same requirement twice; a requirement 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 FoodSpecifications_Requirements.
- Productionhttps://apis.traceone.com/spec/v2/food/specifications/{specificationId}/chapters/{chapterType}/requirements
curl -i -X PUT \
'https://apis.traceone.com/spec/v2/food/specifications/{specificationId}/chapters/{chapterType}/requirements' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"requirementIds": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}'