Pagination
Endpoints that GET
a list of objects (e.g. shipments) are paginated. Anytime you make a request, you can optionally specify a page number and/or a page size.
Query Parameter | Type | Default | Description |
---|---|---|---|
pageNumber | Integer | 1 | The page offset. |
pageSize | Integer | 50 | The maximum number of results to return per page. Any number larger than the default will fall back to 50. |
Paginated endpoints will return:
- totalRecords: The number of records (e.g. devices) that were returned with your request.
- pageSize: The number of results returned per page.
- pageNumber: The page offset number. For example, if there were 150 total results, you would need to make requests for page 1, 2, and 3 to retrieve all results.
- data: The data returned from the API request.
- next: The url for the next page of results if one exists. This field will not be returned if there is not a next page to retrieve.
- previous: The url for the previous page of results if one exists. This field will not be returned if there is not a previous page to retrieve.
//GET https://api.tive.com/public/v3/{endpoint}?pageNumber=2&pageSize=2
{
"totalRecords": 6,
"pageNumber": 2,
"pageSize": 2,
"data": [
{...},
{...}
],
"next": "http://api.tive.com/public/v3/{endpoint}?pageSize=2&pageNumber=3",
"previous": "http://api.tive.com/public/v3/{endpoint}?pageSize=2&pageNumber=1"
}
Updated about 2 years ago