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 is tentative.
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 inequality filters are supported outside of dates, date-times and date-time-offsets. Filters are most often named with the corresponding property. For inequality filters, 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.
In this second case, the query parameter value must conform to a date-range, a date-time-range or a date-time-offset-range,
depending on the type of the attribute.
For example, retrieving all leave resources which were created between 04:00 PM and 08:00 PM (UTC) on Jan. 1st 2023:
Please note that open-ended ranges are supported through the ”..” characters: ?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.