CDRs

Aggregate CDRs

Aggregate the Call Analytics call records into grouped summary rows over a required date range.

When to use. Produce summary rows (totals, durations, ACD, ASR, cost) grouped by one or more dimensions such as campaign, user, or country. For the individual call rows behind Call Analytics rather than aggregates, use GET /cdrs.

Request body. group and filter are required, and filter must include filter.start_at and filter.end_at. See Core API Concepts.

  • group (string, required): semicolon-separated dimensions to group by, for example campaign;user;call status;duration;country;timezone;network_type.
  • fields (string): semicolon-separated columns to include in each row, for example campaign;user;total calls;successful calls;total duration;ACD;ASR;cost.
  • period (string): semicolon-separated time buckets. Defaults to year;month;day. Example year;month;day;hour.
  • weightSteps (string): weight-step buckets to group by, for example All, 100, 50.
  • filter (object, required): filter criteria. start_at and end_at are required and do not accept an operator. Other keys accept a single value, an array, or a value;operator expression, for example "duration": "5;>|9999;<".
  • order (string): sort order, for example campaign;desc. The field must appear in group or fields.
  • limit (integer): maximum rows to return, 1 to 500, default 500.
  • offset (integer): row offset for pagination.

Notes. callsType accepts an array of call-type ids: PHONEBOOK 2, MANUAL_CALL 3, INCOMING 4, PROGRESSIVE 5, PREDICTIVE 6, MISSED_CALL 7, INTERNAL_CALL 8.

Returns. 201 with an array of aggregated rows. Each row carries the grouped dimensions plus the requested metrics (total, successful, call_duration, call_bill_duration, acd, asr, cost, and so on). Durations are formatted as H:MM:SS and period reflects the chosen buckets.

Example.

{
  "group": "campaign;user;country",
  "fields": "campaign;user;total calls;successful calls;ACD;ASR;cost",
  "period": "year;month;day",
  "weightSteps": "All",
  "filter": {
    "start_at": "2020-01-01 00:00:00",
    "end_at": "2025-01-01 00:00:00",
    "campaign": [22],
    "duration": "5;>|9999;<"
  },
  "order": "campaign;desc",
  "limit": 100,
  "offset": 0
}

Gateway note: for the curated convenience wrapper see calls_statistics.

post/{sub_domain}/api/cdrs/cdrs-aggregate

Request

  • Base URL
    https://api.commpeak.com/dialer
  • URL
    https://api.commpeak.com/dialer/{sub_domain}/api/cdrs/cdrs-aggregate
  • Auth
    API key in header Authorization

Path parameters

sub_domainstring required

Dialer Name (subdomain)

Request body

groupstring required

Semicolon-separated list of fields to group the CDRs by. Required.

fieldsstring nullable

Semicolon-separated list of fields (columns) to include in the aggregated rows.

periodstring nullable

Semicolon-separated time period for aggregation. Defaults to year;month;day.

weightStepsstring nullable

Weight step buckets to group by (Dialer only). E.g. All, 100, 50.

orderstring nullable

Order of the aggregated rows. The field must be present in group or fields.

limitinteger nullable

Maximum number of aggregated rows to return (1-500, default 500).

offsetinteger nullable

Offset for paginating the aggregated rows.

Response

Successful Response

campaign_idinteger nullable
caller_user_idinteger nullable
statusstring nullable
status_id_beforestring nullable
status_id_afterstring nullable
lead_idinteger nullable
dst_countrystring nullable

Destination country name detected from the dialed number prefix, when grouped by destination country. Null when no country could be detected.

periodstring nullable
totalstring nullable
successfulstring nullable
call_durationstring nullable

Formatted as H:MM:SS.

call_bill_durationstring nullable

Formatted as H:MM:SS.

acdstring nullable
asrstring nullable
costnumber nullable
transfer_durationstring nullable
conference_durationstring nullable
transfer_costnumber nullable
conference_costnumber nullable
total_transferstring nullable
call_agent_durationstring nullable

Changes

No recorded changes to this operation across all 1 revision of this API.