Pagination
Each list in the table below comes a page at a time. You choose the page size with limit, and each page gives you a next_cursor to send back for the page after it.
Reading every page
- Call the list with the
limityou want, written in digits, and no cursor. A blanklimitmeans the default, and so does leaving it out. - Read
data, then send the page'snext_cursoras the operation's cursor parameter, with the same filters, for the next page. - Stop when
next_cursoris null, or, where the list hashas_more, when it is false.
Send a cursor back exactly as you received it, and don't build one yourself.
Page sizes
limit takes a whole number from 1 to the largest size below.
| Operation | Default | Largest | Cursor |
|---|---|---|---|
GET /api/gap/v1/referrals | 25 | 100 | starting_after |
GET /api/gap/v1/plans/enrollments | 100 | 200 | cursor |
GET /api/gap/v1/plans/loss-notices | 100 | 200 | cursor |
GET /api/gap/v1/plans/redemptions | 200 | 200 | cursor |
GET /api/gap/v1/plans/statements/{id}/lines | 100 | 1000 | starting_after |
GET /api/gap/v1/eventsAt launch | 25 | 100 | starting_after |
GET /api/gap/v1/auditAt launch | 25 | 100 | starting_after |
Lists that come in one answer
These lists take no limit and no cursor: each comes in one answer, and its entry in the reference says how many it can hold.
Each list's cursor
GET /api/gap/v1/referrals
starting_after: Cursor: the previous page's next_cursor (its last referral's id, or with updated_after an opaque u1. cursor). ?starting_after= is the first page; only spaces is refused.
next_cursor: Pass as starting_after for the next page; null on the last page. With updated_after it is never null: has_more says whether to fetch the next page now, and the last page's cursor is where your next poll resumes.
GET /api/gap/v1/plans/enrollments
cursor: The previous page's next_cursor. ?cursor= is the first page; only spaces is refused.
next_cursor: Pass as cursor for the next page; null on the last page.
GET /api/gap/v1/plans/loss-notices
cursor: The previous page's next_cursor. ?cursor= is the first page; only spaces is refused.
GET /api/gap/v1/plans/redemptions
cursor: The previous page's next_cursor. ?cursor= is the first page; only spaces is refused.
GET /api/gap/v1/plans/statements/{id}/lines
starting_after: The previous page's next_cursor, an opaque position in this statement's lines; the page starts after it. Anything else is a 400. ?starting_after= is the first page; only spaces is refused.
next_cursor: Pass as starting_after for the next page; null on the last page.
GET /api/gap/v1/events
starting_after: The previous page's next_cursor: an opaque position, the last event this feed listed to you; the page starts after it. Never an event's id, not even one a webhook delivered: an event can reach the feed after a newer one's webhook has gone out, so a position taken from a webhook would skip it. A cursor works only for the institution and mode it was issued to; anything else is 400 invalid_cursor. ?starting_after= is the first page; only spaces is refused.
next_cursor: Every page has one, the last and an empty one too: where your next poll resumes. Keep the latest and send it as starting_after; has_more says whether to fetch the next page now.
GET /api/gap/v1/audit
starting_after: The previous page's next_cursor, an opaque position; the page starts after it. Anything else is 400 invalid_cursor. Send the same from and to with it. ?starting_after= is the first page; only spaces is refused.
next_cursor: Send as starting_after for the next page, with the same from and to; null on the last page.