Pagination and Filters
All top-level API resources have support for bulk fetches via the "list" API methods. These list API methods share a common structure, taking at least these two parameters: limit
and offset
.
Alternatively you may request pages by providing these two parameters: limit
and page
.
Pagination Parameters
Parameter | Default | Description |
---|---|---|
limit | 10 | A limit on the number of objects to be returned, between 1 and 100 |
offset | 0 | A cursor to use in pagination. The number of elements to skip. |
page | 1 | A cursor to use in pagination. Uses the limit to calculate current offset. |
Response Format
Parameter | Type | Description |
---|---|---|
data | array | The array of objects requested. |
has_more | boolean | Whether or not there are more elements available after this request. If |
total_count | number | Number of total elements that exist. |
Filter Parameters
For any resource you are querying via the top-level API you can pass any attributes of those objects to filter on.
An example query url might look like the following:
You can also pass modifiers to modify the filters. The modifiers must be in the query parameter ops
and have the format <attribute_name>:<operation>
, where operation is any of the following:
Operators
Name | Type | Comparison |
---|---|---|
equals | === | attribute === value |
ne | !== | attribute !== value |
lt | < | attribute < value |
lte | <= | attribute <= value |
gt | > | attribute > value |
gte | >= | attribute >= value |
beginsWith | string begins with | attribute.beginsWith(value) |
contains | string or array contains | attribute.contains(value) |
Multiple operators can be applied by separating each token with a comma: <attribute_name1>:<operation1>,<attribute_name2>:<operation2>
An example query url might look like the following:
Sorting
For any resource you are querying via the top-level API you can pass the sort
and direction
parameters.
An example query url might look like the following:
The direction query parameter can be either asc
or desc
.
Last updated