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.

CursorPage numbers
Best forLong lists that keep growingShort lists you want to jump around in
You sendcursor and limitpage and limit
Used byFiles, comments, notifications, the audit logPeople, invoices, API keys, rules, file versions, webhooks
Answer includesnextCursor and hasMorepage, total and totalPages

Cursors

Ask for a page:

curl
curl "https://gridline-data-analysis-app.duckdns.org/api/files?limit=20" -H "Authorization: Bearer gl_live_YOUR_KEY"
Response
{
  "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
curl "https://gridline-data-analysis-app.duckdns.org/api/employees?page=2&limit=25" -H "Authorization: Bearer ACCESS_TOKEN"
Response
{
  "data": [ … ],
  "meta": { "page": 2, "limit": 25, "total": 61, "totalPages": 3 }
}

Limits

  • limit is from 1 to 100. The default is 20.
  • page starts at 1.
  • Asking for a parameter an endpoint does not have is a 400.