Skip to content

Retrieves call detail records (CDRs) for call sessions.

Retrieves call detail records (CDRs) for call sessions

Method get.call_legs_report
Description Retrieves call detail records (CDRs) for call sessions.
Who has access Partners and clients

Request parameters

Name Type Required Valid values Description
access_token string yes Authentication session key
user_id number no Unique user identifier of the agent client on behalf of which the request is made (Is required for the agent) To obtain a list of client users, you must use the method ""get.customer_users""
limit number no Number of records returned. See section "Paging"
offset number no Shift determines from which record number to return "limit" records. The default is "0". See section "Paging"
filter object no See section "Filtering Criteria"
sort array no See section "Sorting data"
date_from iso8601 yes YYYY-MM-DD hh:mm:ss Start date and time of the reporting period.
date_till iso8601 yes YYYY-MM-DD hh:mm:ss End date and time of the reporting period.

Response parameters

Name Type Valid values Filtering Sorting Default response Description
id number yes yes Unique CDR identifier
call_session_id number yes yes yes Unique call session identifier (see "get.calls_report" method)
call_records array yes ID used to access the call recording. Open the following URL in a browser: http://app.callgear.com/system/media/talk/{call_session_id}/{recording_link_id}
start_time iso8601 YYYY-MM-DD hh:mm:ss yes yes Leg start date and time
connect_time iso8601 YYYY-MM-DD hh:mm:ss yes On-hook date and time
duration number yes yes yes Duration of the leg from the beginning of picking up the handset. Value in seconds
total_duration number yes yes yes Total length of the leg. Value in seconds
finish_reason enum yes yes yes Reason for ending the leg
finish_reason_description string yes yes no Description of the reason for ending the leg
virtual_phone_number string yes yes yes Virtual number
calling_phone_number string yes yes yes Caller ID
direction enum in, out yes yes yes Leg direction
is_transfered boolean true, false yes yes yes Is this a transfer leg?
is_operator boolean true, false yes yes yes Does this leg belong to the operator
employee_id number yes yes yes Unique ID of the employee who was called.
employee_full_name string yes yes Full name employee who was called
employee_phone_number string yes yes Employee phone number
employee_rating number yes yes yes Rating assigned to an employee in post-call processing
scenario_id number yes yes yes Unique Script ID
is_coach boolean true, false yes yes yes Is it a coach's leg?
release_cause_code number yes yes yes Cause Code Number (see Q850) (deprecated is obsolete and will be removed soon)
release_cause_description string yes yes yes Description cause code (deprecated is outdated and will be removed soon)
is_failed boolean true, false yes yes yes Did the operator pick up the phone
is_talked boolean true, false yes yes Did the conversation take place
contact_id number Unique Contact ID
contact_full_name string Full name contact
contact_phone_number string For inbound calls, the contact number that placed the call. For outbound calls, the contact number that was called.
action_name string yes yes Name of the hit operation in which the call was created
group_id number yes yes Unique ID of the employee group associated with the call.
group_name string yes yes Name of the employee group associated with the call.

Call leg completion reasons

Mnemonics Description
caller_disconnects The caller disconnected.
no_operation No operation to process
operator_busy Employee is busy
operator_not_responsive Employee not responding
operator_disconnects The employee disconnected
operator_number_problems Problems with the employee's phone number. Contact technical support.
scenario_not_found Script not found
timeout The call time has expired
internal_error Internal error. Contact technical support.
transfer_disconnects Disabling an employee during a transfer
scenario_disconnects Disabling an employee when running a script
fax_session_done Fax received
another_operator_answer We reached another employee
caller_busy The caller is busy.
caller_not_responsive The caller did not answer.
caller_number_problems There is a problem with the caller's phone number. Contact technical support.
operator_answer We reached an employee
operator_channels_busy Out of available lines at the forwarding number
app_is_inactive Client blocked
component_is_inactive Component not active
locked_numb Calls to this number are prohibited by security settings
incorrect_input Invalid input
call_not_allowed_on_tp The call is prohibited according to the tariff plan
account_not_found CallGear account not found.
contract_not_found Contract not found
locked_phone Network problems
max_in_call_reached Line limit for incoming calls reached
max_out_call_reached Line limit for outgoing calls reached
employee_busy Employee talking on another call
employee_busy_after_call Employee busy after calling
phone_group_inactive_by_schedule Group of numbers is inactive according to schedule
employee_inactive Employee inactive
max_transition_count_exceeded The maximum number of transitions for script operations has been reached
phone_protocol_not_allowed_by_status Calls from this type of number are prohibited by status
employee_phone_not_found The number has been changed or deleted
action_interval_exceeded The interval specified for the operation has been exceeded
in_call_not_allowed Incoming calls are prohibited
call_enqueued Call queued
employee_status_available Employee with "Available" status
employee_auto_status_do_not_disturb Employee in automatic Do Not Disturb status
employee_status_break Employee in "Break" status
employee_status_do_not_disturb Employee in "Do Not Disturb" status
employee_status_not_at_workplace Employee with "Away" status
employee_status_not_at_work Employee with "Out of Office" status
employee_inactive_by_schedule Employee is inactive according to schedule
group_phone_inactive Group number unavailable
employee_phone_inactive Employee number is inactive
employee_phone_inactive_by_schedule Employee number is inactive according to schedule
fmc_is_locked FMC line blocked
sip_trunk_is_locked SIP trunk blocked
sip_offline SIP line is not registered
fmc_is_disabled FMC service disabled
employee_status_auto_out_call Employee in the status "Outgoing call"
limit_exceeded Financial limit reached
no_money Insufficient funds
out_call_not_allowed_by_status Outgoing calls are prohibited by status
out_call_not_allowed Outgoing calls are prohibited
internal_call_not_allowed Internal calls are prohibited
external_call_not_allowed External calls are prohibited
internal_call_not_allowed_by_status Internal calls are prohibited by status
auto_out_calls_not_allowed_by_status Outgoing calling is prohibited by status

Example request

{
"jsonrpc":"2.0",
"id":"number",
"method":"get.call_legs_report",
"params":{
"access_token":"string",
"user_id":"number",
"offset":"number",
"limit":"number",
"date_from":"iso8601",
"date_till":"iso8601",
"filter":{
},
"sort":[
{
"field":"string",
"order":"string"
}
],
"fields":[
"string"
]

}
}

Example response

{
"jsonrpc":"2.0",
"id":"number",
"result":{
"metadata":{

},
"data":[
{
"id":"number",
"call_session_id":"number",
"call_records":[

],
"start_time":"iso8601",
"connect_time":"iso8601",
"duration":"number",
"total_duration":"number",
"finish_reason":"enum",
"finish_reason_description":"string",
"virtual_phone_number":"string",
"calling_phone_number":"string",
"called_phone_number":"string",
"direction":"enum",
"is_transfered":"boolean",
"is_operator":"boolean",
"employee_id":"number",
"employee_full_name":"string",
"employee_phone_number":"string",
"employee_rating":"number",
"scenario_id":"number",
"scenario_name":"string",
"is_coach":"boolean",
"release_cause_code":"number",
"release_cause_description":"string",
"is_failed":"boolean",
"is_talked":"boolean",
"contact_id":"number",
"contact_full_name":"string",
"contact_phone_number":"string",
"action_id": "number",
"action_name": "string",
"group_id": "number",
"group_name": "string"
}
]
}
}

Possible errors

See the "Errors for get methods" section.