Pagination
Cursor-based pagination is a popular method for retrieving large amounts of data from an API in smaller chunks. This method lets the client specify the cursor's position and retrieve the next page from the API.
Usage
On the paginated endpoints, the client will receive a response containing the meta
field, for example:
{
"resources": [
// ...
],
"meta": {
"cursor": "aWRfX2U2YTgyYTc0LTExNzAtNGY1Ny1hMDMxLWIzNmYzZjZiYzA5Mw",
"limit": 100
}
}
To fetch the next page, the client must pass the cursor
[GET] parameter to the following request, like this: GET /contacts?cursor=aWRfX2U2YTgyYTc0LTExNzAtNGY1Ny1hMDMxLWIzNmYzZjZiYzA5Mw
.
When cursor
is null in the response, there is no next page.
The client receives the first page when the cursor
parameter is null or not passed in the request.
Updated 10 months ago