Pagination
Read a long list one page at a time with a cursor.
Read a list, such as List payments, one page at a time, newest first.
A page
{
"data": [
{ "id": "0b6f3c1e-8f2a-4a51-9a57-6d1f0c2b7e93", "status": "SUCCEEDED" },
{ "id": "9c2e1a7b-4d3f-4b8a-a6e5-3f2d1c0b9a87", "status": "FAILED" }
],
"hasMore": true,
"nextCursor": "eyJjIjoiMjAyNi0wOS0yOFQwOToxNTozMFoiLCJpIjoiMGI2ZiJ9.x7Qm"
}| Field | Meaning |
|---|---|
data | The items on this page. An empty list when there are none. |
hasMore | true if more items follow. |
nextCursor | Pass it as cursor to get the next page. Absent on the last page. |
Reading every page
- Ask for the first page without
cursor. Setlimitto the page size you want, from 1 to 100. The default is 20. - While
hasMoreistrue, ask again withcursorset to the last page'snextCursor.
curl "https://malipo.flex.co.tz/api/v1/payments?limit=50&cursor=eyJjIjoi...x7Qm" \
-H "Authorization: Bearer <token>"Pass nextCursor back as it is. Do not read or build one. A cursor only works with your own keys.
New payments that arrive while you page never make you see an item twice or miss one.