Pagination
Some endpoints that return a list of items use pagination to ensure fast response times for all API clients. Below is an example of how pagination is used when listing all holders in the access control system.
Request
Paginated requests can be customized using the page
and per_page
query string parameters.
GET https://systems.pdk.io/{{system_id}}/holders?page=3&per_page=10 HTTP/1.1
Authorization: Bearer {{system_token}}
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
system_id | Path | String | Yes | The system id. |
page | Query | Integer | No | The zero-based page number. The default value is 0. |
per_page | Query | Integer | No | The number of items per page. The default value is 10 and the maximum value is 100. |
system_token | Header | String | Yes | A valid system token. |
Response
Paginated responses will include the Link
and X-Total-Count
headers.
HTTP/1.1 200 OK
Content-Type: application/json
Link: <https://systems.pdk.io/{{system_id}}/holders?per_page=20>; rel="first", <https://systems.pdk.io/{{system_id}}/holders?page=2&per_page=20>; rel="prev", <https://systems.pdk.io/{{system_id}}/holders?page=4&per_page=20>; rel="next", <https://systems.pdk.io/{{system_id}}/holders?page=10&per_page=20>; rel="last"
X-Total-Count: 123
...
Header | Description |
---|---|
Link | A comma-delimited list of first , prev , next , and last links. |
X-Total-Count | The total number of items. |