Pagination and sorting

Query parameters

The API client can specify some pagination parameters in the query string:

Parameter nameDescription
pageThe current page index. Starts from 0.
sizeThe number of objects per page.
sortThis 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 nameDescription
total_pagesThe number of total pages in the response.
total_objectsThe number of total objects in the response.
limitThe number of objects per page. Defaults to 20.
pageThe current page index; starts from 0.