Recent searches
No recent searches
Send which fields we want returned in the API response
Posted Nov 14, 2022
Is there a way to send which fields we want returned through the tickets API?
The situation we are finding ourselves in is we make an API to get ticket info and it returns all of the custom fields. This in and of itself isn't horrible (also isn' the best) but if we want to do anything with the response, such as looking up a specific field ID to get its value we need to iterate through all fields to get it. This can take time and in the world of automation time is never on your side. Our though is that if we can specify which id's we want returned this would be a non-issue. If thats not possible then is there a recommended search method, I should be looking into to be more efficient when iterating through the custom_fields array?
1
3 comments
Stephen
Hi, I have the same issue. I was thinking Graph QL might resolve the issue, but it looks like it is only available for searching companies at the moment: https://developer.zendesk.com/api-reference/sales-crm/search/graphql/
Is there any advice or way to select what we get back? I just want the ticket IDs, but I'm getting back loads of custom fields, as well as everything else when I make the request.
0
Greg Katechis
Hi Andrew! We do not have offer a direct method to accomplish this with our ticket APIs, we just recommend doing exactly what you mentioned...iterating through the list of tickets and returning the specific data that you need. With the search API, you could find tickets that have a specific custom field's value, but that will still return the entire ticket object and not just the custom fields that you are looking for.
0
Andrew
That is unfortunate but understandable.
0