Understanding incremental article exports
The List Articles section in the API reference docs lists several ways to get articles. One option lets you list all the articles with metadata that changed after a specified start time. This approach is also known as an incremental export.
The incremental article export endpoint looks as follows:
https://{subdomain}.zendesk.com/api/v2/help_center/incremental/articles?start_time={start_time}
where {start_time}
is an epoch time such as 1618348927. The endpoint returns any article that had any of its metadata change after the start time.
Making incremental exports
To make sure you don't skip articles or get the same articles again over successive exports, use the end time of the previous export as the start time for the next export. For example, if the end time of your last export was the epoch time of 1617224682 (2021-03-31T21:04:42 UTC), then use that time as the start time for your next export.
Authenticating the requests
Unlike the other list article options, which allow anonymous requests, you must be an agent or admin to use the incremental article export endpoint. For more information, see Security and authentication in the reference docs.
Paginating through the results
The pagination method of the incremental List Articles endpoint differs in two important ways from the offset pagination method of the Help Center API.
-
The endpoint returns up to 1,000 articles per page.
While 1000 articles seems like plenty, it's surprisingly easy for a large and active help center to reach and surpass the 1000-article limit. The reason is that the endpoint returns articles with any metadata change. It's a good idea to filter the results.
-
The
next_page
url doesn't specify a next page number such aspage=2
. Instead, it specifies a new start time, which is the time of the last change of the last item on the current page. The response also records this time as theend_time
of the current page.For example, if the request's initial
start_time
is 1617731790, the response may contain the followingnext_page
andend_time
values:"next_page": "https://support.zendesk.com/hc/api/v2/incremental/articles.json?start_time=1617733880",
"end_time": 1617733880,
...
Note that the start time of
next_page
is different than the initial start time and is equal to the page'send_time
.
Example
For an example of using incremental article exports, see Downloading articles edited after a start time.