Pagination

When using GET endpoints that are retrieving a large data-set (i.e. notifications across an entire day), the initial response will only constitute a subset of the entire data-set. The default page_size (size of the returned JSON) has a default value of 100 values and a maximum value of 200 which can be specified by the user upon making the API request. Pagination prevents the extraction of large data-sets which could lead to issues or errors while making the request.

Each API response will return a next_page_token included in the JSON which can be used to retrieve the subsequent subset. In order to retrieve the following data sets, users must execute additional requests by using the previous next_page_token as the page_token parameter.

How does pagination work in the Verkada API?

A pagination endpoint in the API accepts two special query parameters:

ParameterTypeDescription
page_sizeIntegerThe number of items returned in a single response.
Default is 100. Max is 200.
page_tokenStringThe pagination token used to fetch the next page of results.

A pagination endpoint in the API will return a special response field:

ParameterTypeDescription
next_page_tokenStringThe pagination token used to fetch the next page of results.

If a non null next_page_token is returned in the API response, then the subsequent request needs to use the next_page_token as the page_token to receive the next page of results.

If a null value is returned for next_page_token, then the request can be considered complete and the user has received all results for the paginated endpoint.

🚧

Paginating through all results

This method of pagination is used to iterate through a result set until all results have been fetched, not to directly go to page X of the results. This is not possible.