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 proper 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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "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.