Skip to content

Good to know

Filtering data

For some endpoints, you are able to filter the data received using the available 'col_order' options. If you wish to filter any of these columns, you will need to provide two additional parameters to your request.

filter operator

You will need to specify a 'filter_operator' parameter. This can be 'all' or 'any'. This determines if the results returned need to match just one more more of the filters you apply (any)- or that the returned data should match all the filters you have set (all).

filter rules

You will need to pass a filter_rules parameter, which is an array containing each rules (object) that you which to apply. An example can be seen below:

json
{
  "filter_operator": "any",
  "filter_rules": [
    {
      "rule":"keyword",
      "operator":"contains",
      "operand":"Keyword",
      "value":"suits"
    },
    {
      "rule":"keyword",
      "operator":"contains",
      "operand":"Keyword",
      "value":"suits"
    }
  ]
}

Each rule object is structured as the following:

json
{
  "rule":"keyword", // the column to filter. Needs to be direct match.
  "operator":"contains", // the filter type applied.
  "operand":"Keyword", // NOT required- but usually the same value as rule
  "value":"suits" // The actual value used to perform the filter
}

The available operator types you can use for each column is dependent on that data type, which is either numeric or string and easy to determine.

For string values, you can use the following operators:

operator
=
<
<=
>
>=

For numeric values:

operator
contains
not contains
equals
not equals
begins with
ends with
not begins with
not ends with