Querying of list calls
LIST calls (GET /entity) can be filtered using a query parameter.
When using REST, these query parameters are built like this: query[FIELD]=VALUE and for an operator, filters look like this: query[FIELD][OPERATOR]=VALUE.
Using the exact key multiple times will result in the VALUE being aggregated into an array in the API. By default, they will result in an IN query:
<apiServer>/api/transactions?query[kind]=CK&query[kind]=RGIt is equal to:
<apiServer>/api/transactions?query[kind][$in]=CK&query[kind][$in]=RGNegative matching is done using the $neoperator:
<apiServer>/api/transactions?query[kind][$ne]=CKFor pagination settings please consult the api definition, e.g. /api/identities/identities-list.
Operators
| Operator | Name | Description | Usage Example |
|---|---|---|---|
$eq | Equal | Exact match of the value | query[FIELD]=VALUE or query[FIELD][$eq]=VALUE |
$ne | Not equal | Negative match of the value. The value of returned items is not equal to the queried value. | query[FIELD][$ne]=VALUE |
$in | In | Values of the returned items are one of the queried values. | query[FIELD][$in]=VALUE1&query[FIELD][$in]=VALUE2 |
$notIn | Not in | Values of the returned items do not contain the queried values. | query[FIELD][$notIn]=VALUE&query[FIELD][$notIn]=VALUE2 |
$like | Like | Partial match of the value, use % as wildcards. %ayment% will return every item containing ayment in the specified field. | query[FIELD][$like]=VALUEExample: query[label][$like]=%ayment% |
$gt | Greater than | Values of returned items are greater than the queried value. | query[FIELD][$gt]=VALUEExample: query[valuedate][$gt]=2023-01-01 |
$gte | Greater than or equal | Values of returned items are greater than or equal to the queried value. | query[FIELD][$gte]=VALUEExample: query[valuedate][$gte]=2023-01-01 |
$lt | Less than | Values of returned items are less than the queried value. | query[FIELD][$lt]=VALUEExample: query[valuedate][$lt]=2023-01-01 |
$lte | Less than or equal | Values of returned items are less than or equal to the queried value. | query[FIELD][$lte]=VALUEExample: query[valuedate][$lte]=2023-01-01 |
$is | Is | Compare value to null | query[FIELD][$is]=$null |
$not | Not | Compare value to not null | query[FIELD][$not]=$null |
Value Operators
| Operator | Name | Description | Usage Example |
|---|---|---|---|
$null | null | Compare value to null | query[FIELD][$is]=$null |
$now | now | Compare value to now | query[FIELD][OPERATOR]=$now |
Examples
Search Transactions by label
<apiServer>/api/transactions?query[label][$like]=%pay%Filter Transactions using $in and $notIn
<apiServer>/api/transactions?query[kind][$notIn][]=RG&query[kind][$notIn][]=DR&query[kind][$notIn][]=RR&query[kind][$notIn][]=CF&query[kind][$notIn][]=PA&query[method][$in][]=RM&query[method][$in][]=PP&query[method][$in][]=WT&query[method][$in][]=DD&query[method][$in][]=CT&query[method][$in][]=SO&query[method][$in][]=AV&query[method][$in][]=BP&query[method][$in][]=AD&query[modified][$gt]=2022-02-02T01:03:38.767Z&query[resultcode]=0&query[valuedate][$gt]=2016-01-01