Because many ACME API calls return a lot of information, we have included pagination on most of our responses. On a paginated call, response data is split into chunks - or pages - and the first page is returned in the response. This allows the API to return the first group of results while the back end is still working through the request.
Pagination data is appended to the end of the API response and will look like this:
{ "list": [RESPONSE DATA], "pagination": { "page": 1, "pageSize": 50, "sortDirection": "asc", "sortField": "name", "count": 500 } }
Key | Description | Parameter |
page | Page number of the displayed results | page=1 |
pageSize | Number of records included in each page | pageSize=50 |
sortDirection | Results sorting direction (“asc” or “desc”) | sortDirection=asc |
sortField | Field by which results are sorted | sortField=name |
count | Total number of records returned by this call |
Page (required)
To determine the number of pages needed to retrieve all results from a paginated call, divide the count by the pageSize and round up. In the example above, you’ll need to call the API 10 times to get all results.
500 records / 50 records per page = 10 pages
Page Size (required)
We recommend limiting the page size to 1000 or fewer results to avoid the potential for timeouts or excessive memory use causing the server to kill the process. This is especially important on more complex objects like Events and Event Templates.
sortField and sortDirection (optional - generally not used)
Some API calls will allow for sorting the results included in the response. These fields are included in the standard pagination response but aren’t always used. See individual API reference docs for supported sorting options.