Filter
In ID360 we provide filtering option same as of SCIM
https://id360.manageengine.com/api/v1/users?filter=firstName eq "John" and lastName eq "Doe"
Filter Characteristics
- Infix expression : SCIM uses infix expression for filter.
- Case Insensitive : Attribute names and attribute operators used in filters are case insensitive
- Structure : Each expression MUST contain an attribute name followed by an attribute operator and optional value
- Muti-Expression Support : Multiple expressions MAY be combined using logical operators
- Grouping : Expressions MAY be grouped together using Round brackets "(" and ")"
- String Case Sensitivity : When comparing attributes of type String, the case sensitivity for String type attributes SHALL be determined by the attribute's "caseExact" characteristic
filter=userName eq "bjensen"
filter=name.familyName co "O'Malley"
filter=userName sw "J"
filter=title pr
filter=meta.lastModified gt "2011-05-13T04:42:34Z"
filter=meta.lastModified ge "2011-05-13T04:42:34Z"
filter=meta.lastModified lt "2011-05-13T04:42:34Z"
filter=meta.lastModified le "2011-05-13T04:42:34Z"
filter=title pr and userType eq "Employee"
filter=title pr or userType eq "Intern"
filter=userType eq "Employee" and (emails co "example.com" or emails.value co "example.org")
filter=userType ne "Employee" and not (emails co "example.com" or emails.value co "example.org")
filter=userType eq "Employee" and (emails.type eq "work")
filter=userType eq "Employee" and emails[type eq "work" and value co "@example.com"]
filter=emails[type eq "work" and value co "@example.com"] or ims[type eq "xmpp" and value co "@foo.com"]
Attribute Operators
Operator | Description | Behaviour |
---|---|---|
eq | equal | The attribute and operator values must be identical for a match. |
ne | not equal | The attribute and operator values are not identical. |
co | contains | The entire operator value must be a substring of the attribute value for a match. |
sw | starts with | The entire operator value must be a substring of the attribute value, starting at the beginning of the attribute value. This criterion is satisfied if the two strings are identical. |
ew | ends with | The entire operator value must be a substring of the attribute value, matching at the end of the attribute value. This criterion is satisfied if the two strings are identical. |
pr | present (has value) | If the attribute has a non-empty or non-null value, or if it contains a non-empty node for complex attributes, there is a match. |
gt | greater than | If the attribute value is greater than the operator value, there is a match. The actual comparison is dependent on the attribute type. For string attribute types, this is a lexicographical comparison, and for DateTime types, it is a chronological comparison. For integer attributes, it is a comparison by numeric value. Boolean and Binary attributes SHALL cause a failed response (HTTP status code 400) with "scimType" of "invalidFilter". |
ge | greater than or equal to | If the attribute value is greater than or equal to the operator value, there is a match. The actual comparison is dependent on the attribute type. For string attribute types, this is a lexicographical comparison, and for DateTime types, it is a chronological comparison. For integer attributes, it is a comparison by numeric value. Boolean and Binary attributes SHALL cause a failed response (HTTP status code 400) with "scimType" of "invalidFilter". |
lt | less than | If the attribute value is less than the operator value, there is a match. The actual comparison is dependent on the attribute type. For string attribute types, this is a lexicographical comparison, and for DateTime types, it is a chronological comparison. For integer attributes, it is a comparison by numeric value. Boolean and Binary attributes SHALL cause a failed response (HTTP status code 400) with "scimType" of "invalidFilter". |
le | less than or equal to | If the attribute value is less than or equal to the operator value, there is a match. The actual comparison is dependent on the attribute type. For string attribute types, this is a lexicographical comparison, and for DateTime types, it is a chronological comparison. For integer attributes, it is a comparison by numeric value. Boolean and Binary attributes SHALL cause a failed response (HTTP status code 400) with "scimType" of "invalidFilter". |
Logical Operators
Operator | Description | Behaviour |
---|---|---|
and | Logical "and" | The filter is only a match if both expressions evaluate to true. |
or | Logical "or" | The filter is a match if either expression evaluates to true. |
not | "Not" function | ̌The filter is a match if the expression evaluates to false. |
Grouping Operators
Operator | Description | Behaviour |
---|---|---|
( ) | Precedence grouping | Boolean expressions MAY be grouped using grouping parentheses to change the standard order of operations, i.e., to evaluate logical "or" operators before logical "and" operators |
[ ] | Complex attribute filter grouping. * Not supported yet. | Service providers MAY support complex filters where expressions MUST be applied to the same value of a parent attribute specified immediately before the left square bracket ("["). The expression within square brackets ("[" and "]") MUST be a valid filter expression based upon sub-attributes of the parent attribute. Nested expressions MAY be used. |
Order of Precedence
Filters will be evaluated using the following order of operations, in order of precedence:
- Grouping operators
- Logical operators - where "not" takes precedence over "and", which takes precedence over "or"
- Attribute operators