Skip to main content
Version: 1.0

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 people in the access control system.

Request

Paginated requests can be customized using the page and per_page query string parameters.

GET https://panel-{{panel_id}}.pdk.io/api/persons?page=3&per_page=10 HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
pageQueryIntegerNoThe zero-based page number. The default value is 0.
per_pageQueryIntegerNoThe number of items per page. The default value is 10 and the maximum value is 100.
panel_tokenHeaderStringYesA valid panel token.

Response

Paginated responses will include the Link and X-Total-Count headers.

HTTP/1.1 200 OK
Content-Type: application/json
Link: <https://panel-{{panel_id}}.pdk.io:443/api/persons?per_page=20>; rel="first", <https://panel-{{panel_id}}.pdk.io:443/api/persons?page=2&per_page=20>; rel="prev", <https://panel-{{panel_id}}.pdk.io:443/api/persons?page=4&per_page=20>; rel="next", <https://panel-{{panel_id}}.pdk.io:443/api/persons?page=10&per_page=20>; rel="last"
X-Total-Count: 123

...
HeaderDescription
LinkA comma-delimited list of first, prev, next, and last links.
X-Total-CountThe total number of items.