I cannot find information about API Pagination or Rate limits at https://developers.activecollab.com/api-documentation/
How many calls are we allowed to make and does pagination exists if we are fetching too much data?
I cannot find information about API Pagination or Rate limits at https://developers.activecollab.com/api-documentation/
How many calls are we allowed to make and does pagination exists if we are fetching too much data?
Many ActiveCollab API end-points are paginated, but not all. You can detect a paginated data set by observing X-Angie-PaginationCurrentPage
, X-Angie-PaginationItemsPerPage
and X-Angie-PaginationTotalItems
headers in the responses. These headers are present in all paginated responses, and they describe how pagination is set (number of items per page) and how many items are in the data set.
Data is paginated by adding page
to the API request query, for example: /api/v1/paginated-resources?page=12
.
There are two common and pracical approaches to paginated data sets:
page
value in the query string until you get an empty result (pages where there are no data don't error, but return empty data set).Example of this #2 principle, with limit to 1000 pages, just in case:
$page = 0;
do {
$response = $this->makeRequest(
sprintf(
'/api/v1/paginated-resource?page=%d',
++$page
)
);
// Do something with response
} while (!empty($response) && $page < 1000);