Pagination
Deprecation Notice
Since October 2023, all List API endpoints support new cursor-based pagination.
Offset-based pagination with
page
query parameter is getting deprecated. In the transition period, endpoints that supported the old offset-based pagination will support both offset-based and cursor-based pagination.Client libraries after a specific version noted below will support only cursor-based pagination.
Cursor-based Query Parameters
Query parameter | Description |
---|---|
cursor | Represents a value that fetches the next page of objects. To fetch the next page of objects, set cursor to the value received in the previous page response. |
page | Represents the maximum number of objects returned in a single page. Defaults to 200 if page is not passed or if page is set higher than 200. |
Cursor-based Response Parameters
Response parameter | Description |
---|---|
cursor | Use this value with the next API query to fetch the next page of objects. |
has_next | Set to true if there are more objects to list in the next page or false if there are no more objects to list. |
Example
Listing the first page of Customers:
curl -X GET "https://api.chartmogul.com/v1/customers?per_page=50" \
-u YOUR_API_KEY:
Response:
{
"entries":
[
{...},
{...},
{...}
],
"has_more": true,
"cursor": "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k"
}
Listing the next page of Customers:
curl -X GET "https://api.chartmogul.com/v1/customers?per_page=50&cursor=AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k" \
-u YOUR_API_KEY:
Client Libraries
Our client libraries will stop supporting old the offset-based pagination. Here's the list of client library versions after which only cursor-based pagination is supported.
Updated about 1 month ago