Introduction
Most collection API endpoints support filtering, which makes it possible to retrieve a subset of resources by applying conditions on their state. For example, you can only retrieve leave objects whose status istentative
.
Filtering is commonly handled through query parameters: /lucca-api/leaves?status=tentative
.
Some query parameters support lists, in which case the server expects a comma-separated list of values: ?status=tentative,confirmed
.
As of now, only strict equality or unequality filters are supported outside of dates, date-times and date-time-offsets. Filters are most often named with the corresponding property. In case of unequality filters, then the property name is prefixed with the ”-” character.
You can only filter on a subset of the object properties.Filtering is implemented on an opt-in basis: each endpoint only supports filtering on a preset of properties. If you feel like a filter is missing, please contact us.
Dates, Date-Times and Date-Time-Offsets
When filtering on date, date-time or date-time-offset properties, you may:- Apply a strict equality filter through a query parameter whose name exactly matches the name of the property.
- Apply an “intersection” filter through a query parameter whose name is
{propertyName}.between
.
?createdAt=..--2023-01-01T20:00:00Z
(all leaves created before Jan. 1st 2023 at 08:00 PM UTC).
More examples:
2024-01-01--2024-12-31
: from Jan. 1st 2024 until Dec. 31st 2024 (included)...--2024-12-31
: until Dec. 31st 2024.2024-01-01--..
: from Jan. 1st 2024.