Skip to content

Get call legs report

Getting CDR for call session

Method get.call_legs_report
Description Getting a list of CDR for call session
Who has access Partner, Customer

Parameters of a request

Title Type Required Valid value Description
access_token string yes Authentication session key
user_id number no Unique user ID of agent's customer who makes request
Is required for agent
To get a list of customer users, use the method "get.customer_users"
limit number no Returning entries count. Refer to "Paging"
offset number no Offset that defines from which number to return the entries "limit". Default value is "0". Refer to "Paging"
filter object no Refer to "Filters"
fields array no Refer to "Viewing returning data"
sort array no Refer to "Data sorting"
date_from iso8601 yes YYYY-MM-DD hh:mm:ss Sampling start date
date_till iso8601 yes YYYY-MM-DD hh:mm:ss Sampling end date

Parameters of a reply

Title Type Valid value Filtering Sorting Reply by default Description
id number yes yes CDR unique ID
call_session_id number yes yes yes Call session unique ID (refer to the method get.calls_report)
call_records array yes ID of a link to the recorded conversation. You can listen to it by making a request in the browser:
http://app.callgear.com/system/media/talk/{call_session_id}/{unique id of the link to a recorded conversiontion}
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 Date and time of answering the phone
duration number yes yes yes Leg duration after phone was answered. Value is in seconds
total_duration number yes yes yes Leg total duration. Value is in seconds
virtual_phone_number string yes yes yes Virtual number
calling_phone_number string yes yes yes Caller number
called_phone_number string yes yes yes Called number
direction enum in, out yes yes yes Leg direction
is_transfered boolean true, false yes yes yes Transfer leg or not
is_operator boolean true, false yes yes yes Operator leg or not
employee_id number yes yes yes Unique ID of a called employee
employee_full_name string yes yes Full name of a called employee
employee_phone_number string yes yes Employee phone number
employee_rating number yes yes yes Post-processing employee rating
scenario_id number yes yes yes Scenario unique ID
scenario_name string yes yes Scenario name
is_coach boolean true, false yes yes yes Coach leg or not
release_cause_code number yes yes yes Cause Code number (refer to Q850)
release_cause_description string yes yes yes Cause code description
is_failed boolean true, false yes yes yes Did an operator answer the phone or not
is_talked boolean true, false yes yes Did the conversation take place or not
contact_id id Contact unique ID
contact_full_name string Contact full name
contact_phone_number string The contact number from which the call was received in case of an incoming call or the contact number to which they made a call in case of an outgoing call
action_id number yes yes Unique ID of the operation when a call was created
action_name string yes yes Name of the operation during which the call was created
group_id number yes yes Unique ID of the group within which the call was made
group_name string yes yes Name of the group within which the call was made

JSON request structure

{
  "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"
    ]
  }
}

JSON reply structure

{
  "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",
        "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"
      }
    ]
  }
}

List of returning errors

Refer to the section "List of errors for the methods with the verb get"