Filtering
You can filter the output of SCIM API calls to list endpoints by providing filter=attribute-name eq attribute-value
as a query parameter with your request. To find out if an endpoint supports filtering, read the API Reference to see if the endpoint accepts a filter
query parameter.
Notes:
The filter parameter is optional. If not specified, the system will return the result without any filtering.
If more than one filter parameter is specified, the object is only returned if it matches all specified filters.
Note:
You cannot specify the same filter option multiple times. You can specify multiple filter options chained by logical AND.
Logical AND and comparison eq are the operators allowed for filtering.
Available filter attributes
Below are the currently available filter options.
Attribute | Available resources |
---|---|
id | Users and Groups |
externalId | Users and Groups |
userName | Users |
displayName | Groups |
Examples
You can send the filter option as query parameters with your request URL.
Eg: https://api.oneflow.com/scim/v1/Users?filter=id%20eq%20%22220006%22
Note: In the ?filter=id%20eq%20%22220006%22 space and " are encoded. Decoded filter parameter of the above example is filter=id eq "220006".
Note:
Make sure to URL encode values that contain URL control characters or Unicode characters.
Below are a few valid filtering examples.
Encoded Filter | Decoded Filter |
---|---|
filter=active%20eq%20true | filter=active eq true |
filter=displayName%20eq%20%22Cloud%22 | filter=displayName eq "Cloud” |
filter=externalId%20eq%20%22Ex-SOLDIER%22 | filter=externalId eq "Ex-SOLDIER” |
filter=userName%20eq%20%22cloud.strife%40shinra.com%22 %20and%20id%20eq%20%221234567890%22 | filter=userName eq "[email protected] and id eq "1234567890" |
filter=userName%20eq%20%22cloud.strife%40shinra.com%22 %20and%20%28id%20eq%20%221234567890%22%20and %20active%20eq%20true%29 | filter=userName eq "[email protected]" and (id eq "1234567890" and active eq true) |
Limitations
Below are a few invalid filtering examples and their limitation.
Invalid Filter | Description |
---|---|
filter=id eq "123" and id eq "456" | You can not use and with the same attribute, cannot specify the same filter option multiple times, can specify one type of filter option only once in the URL. |
filter=id eq "123" and "456" | You can not use and with the attribute values. |
filter=id ne "1234" | You can not use any other comparison operators other than eq (equal) like ne (not equal), gt (greater than), lt (less than), sw (starts with) etc. |
filter=id eq "123" or id eq "456" filter=id eq "123" and not id eq "456" | You can not use any other logical operators other than and line or, not etc. |
filter=title eq "abc" | You cannot filter by unsupported attributes like title. |
Updated about 2 years ago