Search code examples
apizendesk

Zendesk API: get requester info with ticket id


I have in my local database the ticket id, and I need the requester email. To do this I'm doing 2 requests to the Zendesk API, first to get the ticket with the requester_id and second to get the requester information.

Is there a way to do this in one request to the API?

Thanks a lot!


Solution

  • I don't think there's a way to do it in a single request; the Getting Tickets endpoint doesn't seem to include the requester email in the json response, and if you're starting with the ticket id's, it seems like the Getting Tickets endpoint is one you'd want to use.

    However, if you're trying to cut back on requests to the API, you could lump all of the individual requests into two requests (I assume from your question, possibly wrongly, that you're currently doing two requests for each ticket/user pair. My apologies if my assumption is incorrect).

    For example, you could use the Show Multiple Tickets endpoint to get all of the tickets that you want in one request (storing the requester id's from the response), and then use the Show Many Users endpoint to get all of the users associated with the tickets.