Pagination and Filters¶
Many of the Collections APIs that are GET calls include filters and headers that allow the caller to affect how many records they get back and the order that the records come back in. The common filters are as follows:
- Page - Page number to retrieve, defaults to 1.
- PageSize - The number of records to include on each page. Defaults to 20.
- Sort - The fields to sort the results by. By default, values are sorted in ascending order. To sort a field in descending order, prepend a
-
before the field.
The GET APIs also return a series of x-pagination headers that provide metadata about the page being returned as well as how many total pages and records there are. The headers are as follows:
- x-pagination-page - The page number that was retrieved.
- x-pagination-pagesize - The record limit for each page.
- x-pagination-recordcount - The total number of records across all pages.
- x-pagination-pagecount - The total number of pages.
When determining what values you should provide in the paging and sort filters, it is recommended that you do not provide a value of greater than 1000 for the page size as retrieving large numbers of records in a single call can cause unexpected issues with timeouts, and are more susceptible to network issues, such as dropped packets or lost connections.