Skip to main content
Pagination
D
Written by Declan Haigh
Updated over a month ago

Some endpoints use keyset pagination and only return a subset of the available data for various reasons. Such endpoints will return two additional headers:

  • X-Has-Next-Page is true if there is more data to be fetched and false otherwise

  • X-Per-Page refers to the maximum number of items returned per response

Page sizes are not configurable at the moment—they are fixed at 5.

Paginated endpoints will also return an extra key in the JSON body called pagination. For example, a response might look like this:

X-Has-Next-Page: true
X-Per-Page: 5

{
"data": {...},
"pagination": {
"pageSize": 5,
"next": "00000000-0000-0000-000000000005"
}
}

To fetch the next page, add (or replace) the next query param with the ID returned in the response. For example:

https://app.visibuild.com.au/api/v2/projects/visi-counts?next=00000000-0000-0000-000000000005

If there are no subsequent pages, the response will look like this:

X-Has-Next-Page: false
X-Per-Page: 5

{
"data": {...},
"pagination": {
"pageSize": 5,
"next": null
}
}
Did this answer your question?