Pagination
Any data you interact with via the Merge API is able to be paginated. Pagination is specified via the cursor
and page_size
query parameters. Ensure that all query parameters, aside from cursor
and page_size
, remain consistent across pagination to maintain the integrity of your data retrieval. The next
and previous
cursors are attached to paginated API responses. Their values inform the cursor
where to point to next.
cursor
Stringnext
or previous
property of any previous paginated response. When next
or previous
is null there are no more pages to paginate through.page_size
IntegerBelow is an sample request using pagination in HTTP
. The page_size
is set to 20, and the cursor
is pointing to a value for the next page.
GET /api/ats/v1/candidates?page_size=20&cursor=cD0yMDIxLTA3LTI4KzE5JTNBMzglM0EzNi42NzUxNTMlMkIwMCUzQTAwHost: api.merge.devX-Account-Token: {Linked Account Token Here}Authorization: Bearer {Production API Key Here}
In the response payload of an API request to a paginated endpoint, you can find next
and previous
cursors.
These cursors can be attached to future requests to paginated API endpoints to query the next (or previous) page of results, as demonstrated in the following code sample using the Merge SDK:
If you don't want to use the Merge SDK and want to form your own API requests instead, you can do so as illustrated below: