Skip to content

Data Querying

Provider|REST API · OData

All Query* endpoints support a subset of the OData query protocol. Parameters are appended to the request URL as query string arguments and can be combined freely.

Query Parameters

Parameter Description Example
$filter Filter results by conditions $filter=status eq 'Active'
$orderby Sort results $orderby=created desc
$select Choose specific fields $select=id,name,email
$top Limit number of results $top=10
$skip Skip first N results $skip=20

Multiple parameters are separated with &:

$filter=status eq 'Active'&$orderby=created desc&$top=50

Filter Operators

Operator Description Example
eq Equal status eq 'Active'
ne Not equal status ne 'Inactive'
gt Greater than salary gt 50000
ge Greater or equal age ge 18
lt Less than hours lt 40
le Less or equal count le 100

Value Set Filter

The in operator tests whether a field value matches any element in a set of literals:

$filter=status in ('Active','Pending')
$filter=divisionId in (1,2,3)

This is equivalent to a chain of or conditions but more concise.

String Functions

Function Description Example
contains Test for substring contains(name, 'John')
startswith Test string start startswith(email, 'admin')
endswith Test string end endswith(email, '@company.com')

String comparisons are case-insensitive.

Date and Time Functions

Filter by parts of a date/time field:

Function Description Example
year Match year year(created) eq 2024
month Match month (1–12) month(created) eq 3
day Match day of month day(created) eq 15
hour Match hour (0–23) hour(created) eq 9
minute Match minute (0–59) minute(created) eq 30
date Match date part only date(created) eq 2024-03-15

Example — all entries created in March 2024:

$filter=year(created) eq 2024 and month(created) eq 3

Logical Operators

Operator Description Example
and Logical AND status eq 'Active' and age gt 18
or Logical OR role eq 'Admin' or role eq 'Manager'
not Logical NOT not contains(name, 'Test')

Use parentheses to group conditions:

$filter=(role eq 'Admin' or role eq 'Manager') and status eq 'Active'

not works on comparisons and function calls:

$filter=not (status eq 'Inactive')
$filter=not contains(name, 'Test')

Lambda Operators

The any() lambda operator tests whether at least one element of a JSON collection column satisfies a condition. It translates to a correlated EXISTS sub-query in SQL.

Scalar string array

Employees store their division memberships in a Divisions field as a JSON array (e.g. ["HR","Finance"]). Use any() to filter by membership:

$filter=divisions/any(d: d eq 'HR')

Combining with other filters

Lambda expressions combine with regular conditions using and or or:

$filter=status eq 1 and divisions/any(d: d eq 'HR')

Key/value object array

When the collection holds objects with named properties, use property access inside the lambda:

$filter=attributes/any(a: a/key eq 'Department' and a/value eq 'Finance')

Limitation

or inside the lambda body is not supported — use two separate any() calls connected with or instead:

$filter=divisions/any(d: d eq 'HR') or divisions/any(d: d eq 'Finance')

Field Names and Enum Values

  • Field names are case-insensitiveStatus, status, and STATUS all work
  • Enum values are resolved case-insensitively'active' and 'Active' are equivalent

Attribute Fields

Objects with custom attributes support querying via prefixed field names:

Prefix Type Example
textAttributes. String $filter=textAttributes.Department eq 'Finance'
dateAttributes. Date/time $select=id,dateAttributes.HireDate
numericAttributes. Number $filter=numericAttributes.Salary gt 80000

Attribute fields can be used in $filter and $select.

Ordering

Sort by one or more fields. Default direction is ascending (asc); use desc to reverse:

$orderby=identifier,created desc

Selection

Limit the fields returned to reduce payload size:

$select=identifier,name,description

Paging

Page through large result sets using $top and $skip:

$top=100&$skip=1400

Always paginate large datasets. Combine $filter and $select to reduce payload before paging.

Unsupported Features

The following OData features are not supported and will produce an error:

  • $expand — navigation properties
  • $search — full-text search
  • $count inline parameter
  • all() lambda operator
  • Arithmetic operators in filters (add, sub, mul, div, mod)
  • $format

Best Practices

  • Always paginate large datasets using $top and $skip
  • Use $select to reduce payload size — especially when querying attribute fields
  • Combine filters with and to narrow results early
  • For date ranges, combine ge and lt rather than date functions: $filter=created ge 2024-01-01 and created lt 2025-01-01
  • Use in instead of chained or conditions for readability: $filter=status in ('Active','Pending')
  • Avoid unsupported operators — they produce a server error, not an empty result