Filters for list functions

The API supports filtering functionality on list functions using various operators on different keys to refine the query results.

 

Filters

The API parameter filters accepts an array of filter objects, allowing 0 to n filters to be applied.

Exemple based on the contactList function:

{
    "firstName": {
        "LIKE": "Foo%"
    },
    "idContact": {
        ">=": "XX001",
        "<": "XX999"
    },
    "bodyForm": {
        "IN": ["IND", "ORG"]
    },
    "IsOwner": {
        "<>": "1"
    }
}

Filter structure

Each filter object consists of:

Key: The attribute on which the filter is applied.
Operator: Specifies the type of comparison or operation to be performed.
Value(s): The value(s) to be compared against based on the operator.

Value Type Length Description
filters array0-nList of filters to be applied
filters.{key} array1-2Array containing the filter for the key
{key} string0-nKey to apply the filter to
filters.{key}.{operator} string|array0-nValue(s) to be compared against
{operator} string1-8Operator used for filtering


Filter examples :

ComparisonExample
Single value
"{key}": {
"{operator}": "{value}"
}
Multiple values
"{key}": { 
"{operator}": [
"{value1}",
"{value2}"
]
}
Multiple operators
"{key}": {
"{operator1}": "{value1}",
"{operator2}": "{value2}"
}

 

Operators

Available Operators:

OperatorExpected value typeCombinableDescription
=stringNoEqual to
<>stringNoNot equal to
INarrayNoMatches any value in a given set
NOT INarrayNoDoes not match any value in a given set
LIKEstringNoMatches a pattern
NOT LIKEstringNoDoes not match a pattern
>stringYesGreater than
>=stringYesGreater than or equal to
<stringYesLess than
<=stringYesLess than or equal to

Two operators can be combined by using > with < or <=, or < with > or >= for range-based comparisons.

 

Keys

Keys are specific to each function. For more information, see the corresponding pages.