2. Supported OData Query Options

2. Supported OData Query Options

Call Analytics API (beta) uses OData query parameters to filter, select, sort, and page API responses. This guide explains the OData query options supported by Call Analytics API (beta).

Supported query options

Option

Supported behavior

$filter

Required start and end date constraints, plus supported field comparisons and logical operators. See Filter syntax.

$select

Select any field present in the JSON response. Separate multiple field names with commas.

$orderby

Order by any field present in the JSON response. Use asc or desc to specify the direction.

$top

Request the number of records to return. Defaults to 100 and is subject to the server's current maximum of 100. The value must be a positive integer; the server may reduce it to the configured maximum.

$skip

Skip a number of records as an item offset, not a page number.

$count

Omitted or false: do not calculate or return a total. true: return the total number of records matching all filters, independently of the current page and page-size limit.


$expand is not supported.

Field names must match fields in the endpoint's JSON response. An invalid or nonexistent field returns 422 Unprocessable Content with an error message explaining the reason for the failure.

Filter syntax

Every request must include both date constraints in $filter. Use ge for the UTC start date and le for the UTC end date:

  1. $filter=startDateTime ge {{startDate}} and endDateTime le {{endDate}}

Additional filters can use the comparison operators eq, ne, gt, lt, ge, and le; membership operator in; logical operators and, or, and not; and parentheses to group expressions. Supported string functions are contains, startswith, endswith, tolower, and toupper. The date-part functions year, month, and day are also supported.

The following predicates are examples to append to the required UTC date constraints:

  1. callType in ('Inbound', 'Outbound')
  2. contains(to, 'Team Venti')
  3. startswith(to, 'Team')
  4. endswith(to, 'AA')
  5. year(startDateTime) eq 2026
  6. month(startDateTime) eq 10
  7. day(startDateTime) eq 1
  8. tolower(to) eq 'team venti spark aa'
  9. toupper(to) eq 'TEAM VENTI SPARK AA'
  10. not (callType eq 'Inbound')
  11. callType ne 'Inbound'
  12. duration gt '00:30:00' and duration lt '01:00:00'
  13. (callType eq 'Inbound' or callType eq 'Outbound')

For example, the in predicate in a complete request is:

  1. https://api.teamspowerpack.com/_api/v1/CA/RawData?$filter=startDateTime ge 2026-10-01T00:00:00Z and endDateTime le 2026-10-02T00:00:00Z and callType in ('Inbound', 'Outbound')&Application=General&$top=100&$skip=0&$count=true&$orderby=startDateTime asc

Date filter values are in UTC. Use connectedUsers when filtering for users who actually connected to the call; use huntedUsers for users the call attempted to reach or ring, including those who did not answer. 

Combined example

This example selects both user fields, applies the required date range, selects calls where either an actually connected user or a hunted user matches the respective condition, requests up to 100 records, skips zero records, requests the filtered total, and sorts newest first:

  1. https://api.teamspowerpack.com/_api/v1/CA/RawData?$select=connectedUsers,huntedUsers&$filter=startDateTime ge {{startDate}} and endDateTime le {{endDate}} and (connectedUsers eq 'Connected User' or huntedUsers eq 'Rung User')&Application=General&$top=100&$skip=0&$count=true&$orderby=startDateTime desc

URL-encode spaces and other reserved characters as required by the HTTP client. Replace {{startDate}}, and {{endDate}} with the target date/time values.

Validation and pagination

An invalid OData query, invalid $top or $skip value, or invalid date returns 422 Unprocessable Content with a message describing the reason for the failure.

$top must be a positive integer. If the requested page size exceeds the configured maximum, the server may reduce it.

$skip is an item offset. When more matching records remain, follow the absolute HTTPS URL in nextpagelink as returned; it carries the query context needed to continue.

When $count=true, the total is calculated after all applicable filters and is independent of page size, $skip, and NextLink generation. Omit $count or set it to false when a total is not needed.