The Fleetio API returns data set in pages, instead of all at once. This common API pattern allows us to efficiently return query results without putting unnecessary strain on our resources.
In Fleetio, all
index actions return paginated responses. Each page will contain up to
100 items—this number may change though, so don't code yourself into a wall by hardcoding
100 as the expected page size. Fleetio returns four response headers along with the result set to help you work with the paginated data.
|The per page limit. Set to |
|The current page. Defaults to |
|The total number of pages in the result set. Use this along with|
|The total number of records in the result set (across all pages).|
To retrieve data for a specific page, specify the
page query parameter as in the example below.
# Get the second page of results for the vehicles index action.
--header "Authorization: Token YOUR_API_KEY" \
--header "Account-Token: YOUR_ACCOUNT_TOKEN" \
Pages start at
1. If the request does not include a
page parameter, the server will return the first page of results. If the
page parameter is less than
1, it will also return the first page of results. If the
page parameter is greater than
Pagination-Total-Pages, it will return an empty result set.