Flexera One APIs that return collections/lists of records often support filtering. Filtering allows API clients to, in their request, describe which records from the collection they are interested in, so the API can return only those records.
Clients use the
filter query parameter to provide a filter expression which the API evaluates against each record of
the complete collection to decide if it will be included in the filtered response to the client.
The filter expression should always be URL-encoded. Examples provided below are un-encoded for clarity.
The following table describes all valid operators that may be used in filter expressions. Each API documents the subset of operators that is valid when using that API.
||Greater than or equal||
||Less than or equal||
Some important points about building filter expressions:
- Operators should always be lower-cased (
- Operands are case-sensitive, unless otherwise stated by API-specific documentation
- Literal values should always be the right operand (
name eq 'SAP'instead of
'SAP' eq name)
cooperator, the entire operator value must be a substring of the attribute value for a match
Operator precedence determines the order in which operators are interpreted when an expression contains multiple operators. Operators are listed by category in order of precedence from highest to lowest. Operators in the same category have equal precedence, and are evaluated left-to-right.
||Greater than or Equal|
||Less than or Equal|
The following example retrieves a collection of customers with a name attribute containing the string
curl -i https://api.flexera.com/msp/v1/orgs/123/customers \ -H "Authorization: Bearer <accessToken>" \ --get --data-urlencode "filter=(name co 'blue')"
Note the filter expression
(name co 'blue') is URL-encoded by cURL's
--data-urlencode option, and
the request is an HTTP GET request.