Filtering
The awork API supports a huge set of filters that can be executed on all our API controllers.
Every filter can be applied by adding a filterby
expression to the request URL:
Important: Special characters (like ?
, &
and =
) within a string filter value need to be properly url encoded.
If you want to filter by a nested property, you can do this by separating the Properties by /
.
Logical Operations
You can invert the expression by using not
before the statement
Furthermore, you can combine expressions using the logical operator and
You can combine expressions using the logical operator or
Precedence is defined with (
and )
Data types
The data types DateTime and Guid have to be prefixed with the corresponding type identifier datetime
and guid
, respectively, e.g.
/users?filterby=birthDate ge datetime'2018-04-03T00:00'
/users?filterby=id eq guid'12345678-aaaa-bbbb-cccc-ddddeeeeffff'
Null null
Boolean true|false
Byte 0x22
DateTime datetime'2000-12-12T12:00'
Decimal 2.345M
Double 2.029
Single 2.0f
Guid guid'12345678-aaaa-bbbb-cccc-ddddeeeeffff'
Int 32
Long 64L
String 'Hello awork'
Operators
Operator | Description | Query |
---|---|---|
| The 'eq' operator filters and returns the items which matches the filter term. |
|
| The 'ne' operator filters and returns the items which do not match the filter term. |
|
| The 'endswith' operator filters and returns the items which end with the filter term. |
|
| The 'startswith' operator filters and returns the items which start with the string. |
|
| The 'contains' operator filters and returns the items which contain the filter term. |
|
| The 'gt' operator filters and returns the items which are greater than the filter term. |
|
| The 'lt' operator filters and returns the items which are less than the filter term. |
|
| The 'le' operator filters and returns the items which are less than or equal to the filter term. |
|
| The 'ge' operator filters and returns the items which are greater than or equal to the filter term. |
|
| The any operator iterates through the main entity (Project), executes the condition and returns the filtered list of projects where any member with a FirstName 'Neil' exists. |
|
| The count operator iterates through the main entity (Project), and returns the filtered list of projects that have less than 10 members. |
|
Special Operator for the Current User
Term | Description |
---|---|
| Filters for the current user |
Special Operators for Date and Time
Term | Description |
---|---|
| Filters for less than current date-time |
| Filters for greater than start of week |
| Filters for greater than end of week |
| Filters for greater than start of month |
| Filters for greater than end of month |
| Filters for today |
Last updated