API supports paging, filtering, sorting on big lists (GET operation on collection resources). Paging, filtering, and sorting are handled as query parameters in requests, while meta data describing the response are returned as header parameters.
Only the collection GET requests that handle large datasets implement this feature.
Paging accepts query parameters that specify:
per_page - maximum number of resources to be retrieved within a single response (page size)
per_page is < 1 the default page size is usedper_page is set to a predefined maximum value if it’s too bigpage - number of returned chunk within the complete set (page#).
last_page) is returnedThe response header contains:
Link - URLs for navigational links used to retrieve first, previous, next and last page in a datasetX-Count-Per-Page - Requested per_page parameterX-Current-Page - Current page number within the setX-Total-Count - Total element count in the datasetX-Total-Pages - Total pages count in the datasetRequest
Response header
Link header should contain any (optional) filter, sort, and expansion query parameters.
Filtering criteria is included in the request URL as q query parameter which accepts a comma-separated list of field:criteria pairs.
The following example demonstrates a GET request to /api/v1/endpoint.
The q parameter then has the following query parameters:
status = 0name = arduinoTo form this request, the following pattern would be required:
/api/v1/endpoint?q=status:0,name:arduino
A valid curl for a query of this type would look like the following:
When using query parameters, the following match patterns apply to queries:
If filtering is applied the header contains:
X-Filter - filter criteriaSorting criteria is included in the request URL as {sort} parameter as a comma separated list of sorting properties.
The default sort order is ascending.
Descending order is specified with - (dash).
If sorting is applied the header contains:
X-Sort - sort criteria