Recent searches


No recent searches

Getting tickets, capped at 42 pages



Posted Aug 27, 2021

Hi everyone! I recently started using the API for zendesk, and in a order from our admin I am trying to query for all tickets older then 2 years, to delete them. However, I am getting capped at 42 pages for tickets (4186 tickets), we should however have around 23k tickets, why am I not getting all of them?

 

Br,

Nikolai

 


0

5

5 comments

image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey @...,

Thanks for reaching out!

I'll be happy to take a look at this one for you. Can you provide an example of the request you're making to the API? Just be sure to redact any sensitive information, as well.

Tipene

0


Hi @...,

I have no idea if this is right, but I am just trying to query the tickets.json endpoint, /api/v2/tickets from powershell. I have even tried to make a loop, to loop through all pages, 1-100.

Im on a different computer right now, but I guess there is no need for a screenshot. 

Will of course add one if you want it. 

 

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

Thanks for the context, @...! Most likely what’s happening here is that a bunch of the tickets in your Zendesk instance have been archived and therefore not included in the response from the /api/v2/tickets API call. If you’d like to get all tickets including archived, you can use the Incremental Exports API. Here’s a bit more information on using that endpoint:

https://developer.zendesk.com/documentation/ticketing/managing-tickets/using-the-incremental-export-api/

Feel free to let me know if you have any questions!

Tipene

1


Thank you, @.... However, I would like to export all tickets prior to two years ago, is that possible? As the incremental export endpoint only supports start_time. 

 

Thank you,

Nikolai

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

After looking in to this a bit more, it seems like the Search API might be more in line with what you're looking for, specifically, Export Search Results.

Here's an example snippet using that endpoint:

https://{subdomain}.zendesk.com/api/v2/search/export?query=created_at<2019-09-02&filter[type]=ticket

Let me know if this works for you and if you have any questions!

Tipene

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post