Many top-level API resources support bulk fetches through "list" methods. Every list method returns its results in an items array and accepts an optional pageSize parameter indicating how many results to return per page.
Beyond that, two paging styles are used. Check which one applies to the endpoint you are calling.
Page number paging
Request the page you want directly.
Parameters
pageNumber: the page to return. Defaults to1.pageSize: how many results to return per page.
Response
items: the results for this page.totalCount: the total number of records matching your filters, across all pages. This is not the number of records initems.pageInfo: an object describing the current position:currentPage: the page you requested.lastPage: the final page number available.pageSize: the size of the page returned.hasNextPage: whether another page follows.
{
"pageInfo": {
"hasNextPage": true,
"currentPage": 1,
"lastPage": 4,
"pageSize": 100
},
"totalCount": 312,
"items": []
}To page through results, increment pageNumber until hasNextPage is false.
Cursor paging
Follow a token returned with each page. Use this when results may change while you are paging, as cursors are not affected by records being added or removed between requests.
Parameters
page: the cursor token from thenextPageproperty of a previous response. Omit it to get the first page.pageSize: how many results to return per page.
Response
items: the results for this page.nextPage: an optional token to pass aspageon your next request.hasNext: whether another page follows.pageSize: the size of the page returned. This does not have to equal the number of records initems— a page size of 10 may return only 5 records on the final page.
{
"pageSize": 25,
"nextPage": "eyJwYWdlIjoyfQ",
"hasNext": true,
"items": []
}To page through results, repeat the request passing nextPage as page until hasNext is false.
