1. Home
  2. Docs
  3. REST API
  4. Collections

Collections

This page describes a common interface for dealing with lists of items. This ensures that sorting, filtering, and pagination are all done in a uniform way.

Pagination

For pagination, the $offset and $limit query parameters are used to communicate the first item and the number of items to return respectively.

Sorting

Sorting is done by passing a comma separated list of fields to sort by using the $sort query parameter. The sort direction can be set by prefixing the field with either a + for ascending or – for descending order.

Filtering

To filter, the name of the field to filter by should be passed as a query parameter with its value the filter string. Optionally the [OP] suffix may be used to select an operation.

Supported operations for numeric fields are:

  • [gt] for greater than;
  • [gte] for greater than or equal;
  • [eq] for equal;
  • [lte] for less than or equal;
  • [lt] for less than.

For strings the [eq] and [like] operations may be used. By default the [eq] operation is applied.

Example

GET /v1/experiments?$offset=10&$limit=5&$sort=description&descripion[like]=Mind%

This example gets a list of 5 experiments starting at the 10th experiment, only entries whose description starts with “Mind” will be returned. The list is alphabetically sorted by description.