Pagination
Links
When requesting an endpoint that returns a collection, the results will be paginated. The response will contain a links
key with links to first, last, next and previous pages, where applicable, and there will also be a meta
key in the response which contains a count
, page-count
, and current-page
value for the current response.
Example Response with Pagination Links
{
"data": [
...
],
"links": {
"self": "https://api.opentransact.com/v1/profiles?page[size]=10&page[number]=2",
"first": "https://api.opentransact.com/v1/profiles?page[size]=10&page[number]=1",
"last": "https://api.opentransact.com/v1/profiles?page[size]=10&page[number]=10",
"next": "https://api.opentransact.com/v1/profiles?page[size]=10&page[number]=3",
"prev": "https://api.opentransact.com/v1/profiles?page[size]=10&page[number]=1"
},
"meta": {
"count": 100,
"page-count": 10,
"current-page": 2
}
}
Parameters
Parameters
You can also set pagination parameters directly on any request for a list of resources from the API. The following parameters are set within a page
object in the query string.
- Name
size
- Type
- integer
- Description
The number of records to return. Default: 30
- Name
number
- Type
- integer
- Description
The page number to be retrieved.
Example Request with Page Info
curl --request GET \
--url 'https://api.opentransact.com/v1/profiles?filter%5Bapplication-id%5D={APPLICATION_ID}&page[size]=10&page[number]=1' \
--header 'Authorization: Basic {AUTH_TOKEN}'