Zendesk ticket API | Community
Skip to main content

Zendesk ticket API

  • June 13, 2022
  • 3 replies
  • 0 views

3 replies

  • June 13, 2022
Hi Shany,
 
Thanks for posting your question to the Community! I would actually recommend using the Search API to query for multiple tickets by their id's or any other filtering methods.
 
As for only retrieving the status of a specific ticket, you could use the Show Ticket endpoint to retrieve the ticket data which includes the status. However, we don't support a way to get a minimized version of the response body. 
 
Hope this helps!
 
Erica
 
 

  • Author
  • June 14, 2022

Thank you! that's very helpful.

Can I request the two things together? get the status from multiple tickets by their id's.


  • June 16, 2022
Yes you can! It would require a little scripting work. 
The way I would handle it is to push all ticket id's I want to return the status for in an array. 
const arrOfIds = [55, 123, 789, 1123]
 
Then I would create a function to map over that array. At each iteration, I would make the request to the Show Ticket API passing in the current id to retrieve the status. 
function getStatus() {
arrOfIds.map(id => {
** make Show Ticket API request here **
** then return ticket data in new array **
})
}
 
Following that, I would return the ticket id and status. Since we're mapping it will already create a new array for us when returning this data.
 
Hope this helps!
 
Erica