Skip to main content

Filtering

Some APIs, specifically those that return multiple search results, support filtering.

Syntax

The filter syntax is similar to SCIM/RFC7644 but with some small changes:

  • Attribute names are case sensitive
  • "Complex attribute filter grouping" is not supported
  • Not all attributes are seachable, while some hidden attributes may be searchable. Please complain when you find these issues.

The filter is given with a filter parameter, such as:

filter=username Eq "john"

Operators

Supported operators are as listed in RFC7644:

OperatorDescriptionNotes
eqequal

The attribute and operator values must be identical for a match.

This can be used also to search from an array, for example if the parameter's value is an array of strings ["value1", "value2"] and a filter like parameterName eq "value1" is used, then that object would be returned.

nenot equal
cocontainsThe entire operator value must be a substring of the attribute value for a match.
swstarts with
ewend with
prpresent (has value)
gtgreater than
gegreater than or equal to
ltless than
leless than or equal to
Attribute operatorDescriptionBehavior
andLogical "and"The filter is only a match if both expressions evaluate to true.
orLogical "or"The filter is a match if either expression evaluates to true.
not"Not" functionThe filter is a match if the expression evaluates to false.
Logical operatorDescriptionBehavior
( )Precedence grouping
[ ]Complex attribute filter grouping is Not Supported

DateTime filtering

Filter expressions where the value is a string in double quotes and can be parsed as an ISO Instant string, are used as DateTime filters. For example:

Examples

filter=createdDate gt "2017-10-20T07:17:17.606Z"
filter=lastModifiedDate le "2019-05-31T23:59:59.999Z"