Load every page
Some lists are too large to return at once. Mochi returns one page of results and a cursor for the next page. A cursor is an opaque continuation value: use it exactly as returned and do not try to read meaning from it.
Follow the pages
- Make the first request without a cursor.
- Process the returned
data. - If
next_cursorcontains a value, send that exact value as the next request'scursor. - Stop when
next_cursorisnull.
Parameters
| Parameter | Description |
|---|---|
page_size | Number of records requested. Default: 50; maximum: 100. |
cursor | Continuation value returned in the previous response. Leave it out for the first page. |
Example first page:
http
GET /v1/leads/?page_size=50Example response:
json
{
"data": [],
"next_cursor": "opaque-value"
}Request the next page by passing the value unchanged:
http
GET /v1/leads/?page_size=50&cursor=opaque-valueDo not parse, modify, generate, or store business meaning in a cursor. Mochi may reject a changed or old cursor. Treat that as an error. Do not silently restart at page one, because that can duplicate a full export.