Constraints
Last updated
Last updated
Similar to , constraints are used to alter the query of a GET Request to fetch the required data for a specific use-case.
They are slightly different from , as they enable the user to set constraints which are not aimed on a single field value but on relations or many fields.
{route}
- The endpoint you want to retrieve data of
?filter
- To identify the incoming URL parameter
[{constraint}]
- One of the constraints from the listing below
[{field}]
- The field (or relation field) on which the constraint should be applied
[{valueFilter}]
- (Optional) Field value filters for related entries
{value}
- Value depending on applied filters and constraints
GET
/api/{route}?filter[{constraint}][{field}][{valueFilter}]={value}
Constraint that manipulates the Query so that only the entries which doesn't have a relation to the given relation will get returned.
If you want to add a simple doesnt_have constraint without further conditions on specific field values you can just pass the value 1
.
GET
/api/{route}?filter[doesnt_have][{field}]={value}
Constraint that manipulates the Query so that only the entries which have a relation to the given field will get returned.
If you want to add a simple has constraint without further conditions on specific field values you can just pass the value 1
.
GET
/api/{route}?filter[has][{field}]={value}
Constraint that manipulates the Query, so that only the entries which have a relation to one of the given fields, will get returned.
Accepts a comma seperated list of relations.
GET
/api/{route}?filter[where_one_of][{fields}]={value}
This can be combined with to add conditions on field values of the given relation keys.