Collections
The Basecone API exposes most resources through resource collections, these collections have some general properties and behaviours that we will explain in this section.
Paging
Paging can be performed by using the offset and limit parameters, like so:
GET companies?offset=3&limit=5
Parameter | Description |
---|---|
offset | Determines how many items to skip. By default the offset is 0. |
limit | Determines the maximum amount of items to return. By default a collection specific default is used for instance 10. |
Sorting
Sorting can be performed by using the sort parameter, like so:
GET companies?sort=name
By default sorting is done ascending, if you'd like to sort descending prefix the field name with a (-)minus sign.
GET companies?sort=-name
Ranges
If a field has type Range, filtering can be performed using range, like so:
GET transactions?companyId=:id&totalAmount=[:amount,:amount]
Filtering only by upper limit can be performed, like so:
GET transactions?companyId=:id&totalAmount=[null,:amount]
Filtering only by lower limit can be performed, like so:
GET transactions?companyId=:id&totalAmount=[:amount,null]