When filtering using the API, we offer the following three options to assist you in querying your data:

For sample requests, please see the code samples section.

Filter

🚧

The filter object accepts either operator and operands as group expressions or it accepts field and comparator and value as field-value comparisons.

Group expressions:

  • operator An optional string whose values can be either and or or.
  • operands Is a list of self referencing filter objects.

Field-value comparison:

  • field The key which you would like to search against.
  • comparator A comparator enum value.
  • value A value you would like to filter against.
{
	"operator": (optional)string,
	"operands": (optional)[]filter,

	"field": (optional)string,
	"comparator": (optional)string,
	"value": (optional)any,
}

Pagination

page accepts the following:

  • offset The number of results to skip over.
  • limit The number of results to return.
{
	"offset": (optional)int,
	"limit": (optional)int,
}

Sort

When using sort, you can use multiple sort objects to order your outputs in your preferred order. It is important to remember that null values are considered the lower possible value. When using the asc direction null values will appear first, and when using desc they will appear last.

[]sort accepts the following:

  • field is the field by which you would like to sort.
  • direction the direction in which you would like the results returned. This can be either asc or desc.
[
	{
		"field": string,
		"direction": enum,
	}
]

Comparators

ComparatorDescription
eqequal
nenot equal
gtgreater than
gegreater or equal
ltless than
leless than or equal
containscontains
not_containsdoes not contain
is_anyis any (compare a single element against an array)
is_not_anyis not any (compare a single element against an array)
includes_anyincludes any (array)
includes_allincludes all (array)
excludes_anyexcludes any (array)
excludes_allexcludes all (array)
eq_dateequals date
ne_datedoes not equal date
rp_eq_daterelative past equal date
rp_ltrelative past less than date
rp_gtrelative past greater than date
rf_eq_daterelative future equal date
rf_ltrelative future less than date
rf_gtrelative future greater than date

Code Samples

Find a supplier by name

Using the filter rule, we can find a supplier by name:

{
  "filter": {
    "field": "name",
    "comparator": "eq",
    "value": "ACME Corp"
  }
}

Find suppliers with more than 3 remediation requests

{
  "filter": {
    "field": "numRemediationRequests",
    "comparator": "gt",
    "value": 3
  }
}

Find suppliers who have not yet approved a connection, who are located in London and return them two at a time in descending order

{
  "filter": {
    "operator": "and",
    "operands": [
      {
        "field": "approvalStatus",
        "comparator": "eq",
        "value": "unapproved"
      },
      {
        "field": "city",
        "comparator": "eq",
        "value": "London"
      }
    ]
  },
  "page": {
    "offset": 0,
    "limit": 2
  },
  "sort": [
    {
      "field": "connectedAt",
      "direction": "desc"
    }
  ]
}