Offset limit pagination for Management API
Several Management API endpoints use pagination. You may page through data using offset
and limit
query parameters. Responses include a metadata
element with page
information.
Endpoints with pagination
- /recipients/:recipientId/apps
- /subscriptions/:appId
- /subscriptions/:appId/status
- /recipients/:recipientId/providers
Requests
The Management API uses limit offset pagination by default. If an endpoint supports pagination, the request should include offset
and limit
query parameters.
Default
If
offset
andlimit
parameters are not included in requests to the supported endpoints, your response will default to the first page and include fifty items.The metadata will default to
offset = 0
andlimit = 50
Example request
curl --request GET \
--url 'https://sandbox-api.akoya.com/manage/v1/recipients/:recipientId/apps?offset=0&limit=10' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 123'
Response
All responses to endpoints that support pagination will include paging information in a metadata element.
New metadata elements
offset
- number of skipped items (default = 0)limit
- number of items per page (default = 50, must be <=500)totalElements
- total number of elementstotalPages
- total number of pages.
Example response
{
"metadata": {
"page": {
"offset": 0,
"limit": 5,
"totalPages": 866,
"totalElements": 4330
}
},
"providers": [
{
"providerId": "01_one_bank",
"displayName": "01:One Bank"
},
{
"providerId": "purple_bank",
"displayName": "Purple Bank"
},
{
"providerId": "provider:idx0",
"displayName": "A Provider Name"
},
{
"providerId": "provider:idx1",
"displayName": "Another Provider Name"
},
{
"providerId": "provider:idx10",
"displayName": "Example Bank"
}
]
}
How to use limit offset pagination
offset
is your position in the total number of items. To move to the next page, add limit
to the current offset
value for the next request.
Example paging
URL | Description |
---|---|
/providers?products=balances®ister=ANY | Returns the first 50 providers |
/providers?products=balances®ister=ANY&offset=0&limit=25 | Returns the first 25 providers |
/providers?products=balances®ister=ANY&offset=25&limit=25 | Returns provider 26 to 50 |