Filtering

You are able to use filters on many of the GET requests, however there will be some limitations on what you can filter by.

Filters are added as a parameter on the URL.

For example: https://trac.mypebble.co.uk/api/v1/orgs/42/members?till.status.eq=unsynced

Would return member records that had the field status in the till namespace with the value of "unsynced".

Chaining filters

You are able to chain filters, though this has some caveats. The first filter specified is the 'primary filter' which should be used to filter out the most data. This primary filter cannot be used again however

For example: https://trac.mypebble.co.uk/api/v1/orgs/42/members?meta.updatedAt.gt=2023-01-01T10:00:00&meta.updatedAt.lt=2023-01-02T10:00:00 is not allowed

Any other filters however are allowed, such as https://trac.mypebble.co.uk/api/v1/orgs/42/members?meta.updatedAt.gt=2023-01-01T10:00:00&till.status.eq=unsynced

You are able to use the same filter multiple times if it is not the primary filter

For example: https://trac.mypebble.co.uk/api/v1/orgs/42/members?till.status.eq=unsynced&meta.updatedAt.gt=2023-01-01T10:00:00&meta.updatedAt.lt=2023-01-02T10:00:00 is valid

Operators

Each filter may support specific operators.

The available operators are:

  • ns.field.eq=value — true if the field ns.field is equal to the value.
  • ns.field.lt=value — true if ns.field is less than value.
  • ns.field.le=value — true if ns.field is less than or equal to value
  • ns.field.gt=value — true if ns.field is greater than value
  • ns.field.ge=value — true if ns.field is greater than or equal to value

String data types can only use the 'eq' operator.

Boolean data types can only use the 'eq' operator

Numbers and dates can use the 'eq', 'lt', 'le', 'gt', 'ge' operators.

URL encode all values when they contain special characters. e.g. &, ?, /

For example: https://trac.mypebble.co.uk/api/v1/orgs/42/members?core.displayName.eq=John%20Doe

Limitations

  • You are not able to use the same primary filter multiple times.