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"
}
FieldMeaning
dataThe items on this page. An empty list when there are none.
hasMoretrue if more items follow.
nextCursorPass it as cursor to get the next page. Absent on the last page.

Reading every page

  1. Ask for the first page without cursor. Set limit to the page size you want, from 1 to 100. The default is 20.
  2. While hasMore is true, ask again with cursor set to the last page's nextCursor.
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.

On this page