Issue symptoms
When making a request using the API, I'm seeing a 200 response code, but the change I requested was ignored. Why would this be?
Resolution steps
The Zendesk REST API has been developed to be somewhat permissive. As such it will ignore attributes that don't exist within our model and attempt to continue processing the remainder of the request.
An example would be trying to send the following payload to update a ticket with an attribute that is not part of the ticket object, such as this payload:
{ "ticket": { "non_existent_field": "42" } }
The
non_existent_field
attribute will be ignored, and nothing else in the payload is going to cause an error. Note: This header was previously available, but isn't returned at the moment. We are looking into why this is the case.
To see if any fields are ignored, watch for the presence of an
X-Zendesk-Api-Warn
header. The example above will show this in the response headers:X-Zendesk-Api-Warn: Removed restricted keys ["ticket.non_existent_field"] from parameters according to allowlist
REST API best practice
Compare the values being sent in the payload to the response object whenever possible. In addition to catching the above error, this will also let you know if something else within the business rules is modifying the values you're trying to set.