Zendesk Search API and Search Export API often return very different results

5 Comments

  • Devon Edwards Joseph

    Hi there - would it be possible to get some assistance with this question? 

    0
  • Edgar Comper
    Zendesk Customer Advocate

    Hi Devon Edwards Joseph,

    Edgar here from Zendesk Support.

    Could you provide me with an example of each query you're working with?
    I will be checking why the discrepancies are present accordingly.

    0
  • Devon Edwards Joseph

    Hi, Edgar Comper - Thanks for your help.

    Here are the two queries i'm using.

    Search API:

    https://DOMAIN.zendesk.com/api/v2/search.json?query=type:ticket updated>=%sT00:00:00Z updated<=%sT23:59:59Z

    Search Export API:

    https://DOMAIN.zendesk.com/api/v2/search/export.json?query=updated>=%sT00:00:00Z updated<=%sT23:59:59Z&page[size]=1000&filter[type]=ticket&page[after]=

    (I am appending the cursor to the end of this url for subsequent pages - hence the "page[after]=" - also the "%s" is interpolated with a date in the format YYYY-MM-DD)

    If I make these requests, for example for the date 2021-07-13 - the Search API's count field will be "count":718, but the number of results actually exported via the Search Export API is 308 for the same date.

    Is there something I have misunderstood about how these work?

    Thank you for your help, once again.

     

     

     
    0
  • Devon Edwards Joseph

    I have plotted the Search API's 'count' field ('expected', in green) against the actual count returned by the Export API ('actual', in red) on this chart, just to give a sense of when and by how much they are 'off' - in case this helps your investigation at all, Edgar.

    I am assuming that you can get the domain my account is associated with by yourself, but if not, let me know.

    0
  • Edgar Comper
    Zendesk Customer Advocate

    Hi Devon Edwards Joseph,

    Thanks for providing me with the additional details.
    I'm going to register a ticket so we can discuss the discrepancies in relation to this query.

    0

Please sign in to leave a comment.

Powered by Zendesk