Paginating through lists

Have more questions? Submit a request

10 Comments

  • Arlene Salgado
    Comment actions Permalink

    Hi, Charles
    How can I export less than 1000 records with the incremental ticket API??
    I've tried with something like this:
    https://example.zendesk.com/api/v2/exports/tickets.json?start_time=1405469030&per_page=100
    but doesn't works.

    0
  • Dwight Bussman
    Comment actions Permalink

    Hi Arlene,


    There's a few things going on here:



    1. I don't believe the incremental exports endpoint accepts the per_page parameter.



    2. It looks like you're trying to use /api/v2/exports/tickets, which is a different endpoint from the api/v2/incremental/tickets.json used in this article. 

    0
  • Kashish Dup
    Comment actions Permalink

    According to article, the maximum record I can get during ticket's incremental export is 1000. What about other incremental export objects?

    0
  • Dwight Bussman
    Comment actions Permalink

    Hi Kashish,

    Per the incremental exports pagination documentation, all incremental exports pages should return up to 1000 objects.

    "When paginating through an incremental export result set, use the count property to determine when to stop. These endpoints return up to 1000 items per page. If count is less than 1000, then stop paginating. Otherwise, use the next_page URL to get the next page of results."

    0
  • Edward Ionescu
    Comment actions Permalink

    Hi,

    Incremental tickets export doesn't work as expected. You can't export new tickets, only the updated tickets. You can't reach all the pages, for some reason - probably the last page is below 1000 records thus not showing? According to the incremental export, I have no updates on tickets since 05.11 which is impossible. 

    0
  • Bryan Flynn
    Comment actions Permalink

    Hi Edward,

    If you're still having this issue, please open a ticket at support@zendesk.com, so we can look at your account in more detail. You should be getting all your tickets assuming the start time that's passed into the API is correct. This is true across other incremental/bulk export type APIs mentioned in this article as well:

    What is the recommended method to regularly export Zendesk Support data?

    0
  • Edward Ionescu
    Comment actions Permalink

    Hi Brian,

    Thank you very much, already did what you suggested. It works fine now, I should have taken into account the "end_time" value and use it as the next start time. I was using a custom start time and that was causing the issue. 

    0
  • Bryan Flynn
    Comment actions Permalink

    That's good to know you got things working. Thanks for sharing that back here Edward.

    0
  • Tanawat Oonwattana
    Comment actions Permalink

    Hi,

    Is there anyway that we can call API that can go directly to the last page?

    for example, I am calling this endpoint:

    /api/v2/search.json?query=type:ticket+tags:"order_related"+status<pending&per_page=30&page=1&sort_by=created_at&sort_order=asc

    you can see that I am limiting data to be displayed only 30 items per page.

    and how do I call the API to get me to the last page directly?

    Thank you.

    0
  • Dwight Bussman
    Comment actions Permalink

    Hi Tanawat,

    Would it be possible to set your sort_order=desc instead of ascending, so that the results which would've previously been on the last page would now return on the first page?

    0

Please sign in to leave a comment.

Powered by Zendesk