zenpy icon indicating copy to clipboard operation
zenpy copied to clipboard

Search export support for page[size] parameter

Open vilozio opened this issue 1 year ago • 4 comments

Hello,

I am using the search export api endpoint to export a large portion of created tickets and users in a time period.

https://developer.zendesk.com/api-reference/ticketing/ticket-management/search/#export-search-results

I found that Zenpy supports this api with search_export method (though in the docs it's not mentioned).

I wrote this code to export users

from zenpy import Zenpy

zenpy_client = Zenpy(oauth_token="my_token", subdomain="my_domain")
created_at = "2023-09-14T00:39:54Z"
users = zenpy_client.search_export(query=f"created_at>={created_at}", type="user")

This works well, but the number of results is by default 100. In my case it would be great to increase the page size to speed up the export workload.

In the documentation it is mentioned that the parameter page[size] can be used, but seems it is not supported by Zenpy search_export method.

vilozio avatar Oct 03 '23 17:10 vilozio

you may be right. I'll look into it. I tried the URL in the browser, and the URL parameters do in fact take page[size] correctly.

cryptomail avatar May 12 '24 20:05 cryptomail

To prove you correct, just FYI, I used:

export?filter[type]=user&query="*"&page[size]=1

cryptomail avatar May 12 '24 20:05 cryptomail

I'd like to issue some tests to this: https://github.com/facetoe/zenpy/pull/629 still WIP

cryptomail avatar May 13 '24 06:05 cryptomail

@vilozio Wondering if you can help test the PR out? https://github.com/facetoe/zenpy/pull/629

cryptomail avatar May 13 '24 15:05 cryptomail