Build with the API
Pagination
Cursors for long lists, page numbers for short ones.
Lists can be long, so Gridline returns them a page at a time. There are two styles. Which one an endpoint uses depends on how its list grows, and each endpoint's description says.
| Cursor | Page numbers | |
|---|---|---|
| Best for | Long lists that keep growing | Short lists you want to jump around in |
| You send | cursor and limit | page and limit |
| Used by | Files, comments, notifications, the audit log | People, invoices, API keys, rules, file versions, webhooks |
| Answer includes | nextCursor and hasMore | page, total and totalPages |
Cursors
Ask for a page:
curl "https://gridline-data-analysis-app.duckdns.org/api/files?limit=20" -H "Authorization: Bearer gl_live_YOUR_KEY"{
"data": [ { "id": "…", "originalName": "sales-q3.csv" } ],
"meta": { "nextCursor": "eyJjIjoiMjAyNi0xMC0wMlQwOToxNDowMy4yMjFaIiwiaSI6Ij…", "hasMore": true }
}To get the next page, send meta.nextCursor back as cursor. When hasMore is false, you have everything.
curl "https://gridline-data-analysis-app.duckdns.org/api/files?limit=20&cursor=NEXT_CURSOR" \
-H "Authorization: Bearer gl_live_YOUR_KEY"Page numbers
curl "https://gridline-data-analysis-app.duckdns.org/api/employees?page=2&limit=25" -H "Authorization: Bearer ACCESS_TOKEN"{
"data": [ … ],
"meta": { "page": 2, "limit": 25, "total": 61, "totalPages": 3 }
}Limits
limitis from 1 to 100. The default is 20.pagestarts at 1.- Asking for a parameter an endpoint does not have is a
400.