Pagination and Sorting
Query parameters
The API client can specify some pagination parameters in the query string:
| Parameter name | Description |
|---|---|
page | The current page index. Starts from 0. |
size | The number of objects per page. |
sort | This parameter is used to sort the results by a property (or properties). The format is sort=[property1(asc/desc)]. For example to sort contacts by the first name the API client sends ?sort=first_name. Multiple properties are sent as separate parameters: ?sort=first_name&sort=last_name. Each property can have its own sorting direction: ?sort=first_name,asc&sort=last_name,desc. The sorting direction is asc by default. |
Response
A paginated response example:
{
"status": "success",
"data": {
"objects": [
...
],
"pagination": {
"total_pages": 1,
"total_objects": 2,
"limit": 20,
"page": 0
}
}
}
Each parameter explained:
| Parameter name | Description |
|---|---|
total_pages | The number of total pages in the response. |
total_objects | The number of total objects in the response. |
limit | The number of objects per page. Defaults to 20. |
page | The current page index; starts from 0. |