post https://example.td.commpeak.com/integrations/adapters/hook/cdrs/cdrs-aggregate
Aggregate CDRs
This endpoint allows you to aggregate Call Detail Records (CDRs) based on specified parameters.
Request Body
group
(string): Specifies the fields to group the CDRs by. *_Required__*_Example:
"campaign;user;call status;status before;status after;weight;duration;country;timezone;lead file;hangup;destination;caller_id;user group;q850;sip termination status;campaign lead created at;campaign lead updated at;extension number;lead created at;lead updated at;transfer to;conference to;trunk;campaign_lead_id;original_identifier;first_name;last_name;phone_normalized;phone_normalized2;support_site;purchase_site;purchase_date;purchase_amount;purchase_product_name;purchase_card_name;purchase_card_type;purchase_card_digits;email;birthdate;loan_amount;address1;address2;hlr;state;city;zip;assigned_user_permanent;no_ratio;lead_id"
fields
(string): Specifies the fields to include in the aggregated CDRs.
Example:
"campaign;user;call status;status before;status after;weight;duration;country;timezone;lead file;hangup;destination;caller_id;user group;q850;sip termination status;campaign lead created at;campaign lead updated at;extension number;lead created at;lead updated at;transfer to;conference to;trunk;custom fields;period;total calls;successful calls;total duration;total bill duration;ACD;ASR;cost;transfer duration;conference duration;transfer cost;conference cost;total transfer;campaign lead id;lead id;permanent;call agent duration"
period
(string): Specifies the time period for aggregation.
Example: "year;month;day;hour"
weightSteps
(string) weight stepts to group by. Example: ("All"
\"100"
\"50"
)
filter
(object): Contains the filter criteria for aggregating the CDRs. Required (strat_at & end_at) Example:
{
"start_at": "2020-01-01 00:00:00",
// required, operator is not supported
"end_at": "2025-01-01 00:00:00",
// required, operator is not supported
"destination": [
"12",
"464646466465"
],
// single value or array, operator is not supported
"caller_id": [
"4565654654"
],
// single value or array, operator is not supported
"permanent": 0,
// only 1 / 0, operator is not supported
"statusBefore": [
"answered"
],
// array, operator is not supported
"statusAfter": [
"Busy",
"New"
],
// array, operator is not supported
"callAttributes": [
"Conference",
"Transfer"
],
// array, operator is not supported
"campaign": [
22,
0
],
// array of campaigns ids, operator is not supported
"userGroup": [
30
],
// array of groups ids, operator is not supported
"user": [
2,
3
],
// array of users ids, operator is not supported
"country": [
1,
2
],
// array of coutries ids, operator is not supported
"timezone": [
189,
90
],
// array of timezones ids, operator is not supported
"leadFile": [
29,
31
],
// array of lead files ids, operator is not supported
"original_trunk_id": [
2
],
// array of trunks ids, operator is not supported
"callsType": [
6,
4
],
// array of call types ids, operator is not supported
// Allowed call types:
// PHONEBOOK: 2
// MANUAL_CALL: 3
// INCOMING: 4
// PROGRESSIVE: 5
// PREDICTIVE: 6
// MISSED_CALL: 7
// INTERNAL_CALL: 8
"weight": "0;>|999;<=",
"bill_duration": "3;>=",
"duration": "5;>|9999;<",
"original_identifier": "1;>=|9;<",
"first_name": "test",
"last_name": "test",
"phone_normalized": "4454544778787",
"phone_normalized2": "4454544778787",
"support_site": "test",
"purchase_site": "test",
"purchase_date": "2025-01-01 00:00:00;<",
"purchase_amount": "test",
"purchase_product_name": "test",
"purchase_card_name": "test",
"purchase_card_type": "test",
"purchase_card_digits": "123",
"email": "[email protected]",
"birthdate": "1020-01-01 00:00:00;>=;|2050-01-01 00:00:00;<;",
"loan_amount": "50;>|999;<",
"address1": "test",
"address2": "test",
"hlr": "1",
"state": "test",
"city": "test",
"zip": "test",
"assigned_user_permanent": "test",
"no_ratio": "1",
"lead_id": "123;>|9999;<="
}
order
(string): Specifies the order in which the aggregated CDRs should be presented. The field must be selected on group or fields values
Example: "campaignd;desc"
limit
(integer): Specifies the maximum number of aggregated CDRs to return.
Example: 100
offset
(integer): Specifies the offset for paginating through the aggregated CDRs.
Example: 0
Response
The response will include the aggregated CDRs based on the provided parameters.Example:
[
{
"campaign_id": 22,
"caller_user_id": 3,
"status": "NORMAL_CLEARING",
"status_id_before": "answered",
"status_id_after": "answered",
"campaign_lead_weight": 3948,
"object_id": 125673,
"lead_id": 98059,
"period": "2024 06 27 14",
"total": "1",
"successful": "1",
"call_duration": "0:00:05",
"call_bill_duration": "0:00:04",
"acd": "00:00:04(in 1 calls)",
"asr": "100% (in 1 of 1 calls)",
"cost": 0,
"transfer_duration": "0",
"conference_duration": "0",
"transfer_cost": 0,
"conference_cost": 0,
"total_transfer": "0",
"assigned_user_permanent": "0",
"call_agent_duration": "0"
},
{
"campaign_id": 22,
"caller_user_id": 3,
"status": "NORMAL_CLEARING",
"status_id_before": "answered",
"status_id_after": "answered",
"campaign_lead_weight": 3948,
"object_id": 139075,
"lead_id": 84657,
"period": "2024 06 27 14",
"total": "1",
"successful": "1",
"call_duration": "0:00:38",
"call_bill_duration": "0:00:36",
"acd": "00:00:36(in 1 calls)",
"asr": "100% (in 1 of 1 calls)",
"cost": 0,
"transfer_duration": "0",
"conference_duration": "0",
"transfer_cost": 0,
"conference_cost": 0,
"total_transfer": "0",
"assigned_user_permanent": "0",
"call_agent_duration": "38"
}
]