Receiving a report on call sessions

Method get.calls_report
Description Receiving a report on call sessions
Available to Partner, Client

Request parameters

Title 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. 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 Sample start date
date_till iso8601 yes YYYY-MM-DD hh:mm:ss End date vybokri
include_ongoing_calls boolean no Enable ongoing calls

Response parameters

Name Type Valid values Filtering Sorting Default response Description
id number yes yes Unique call session identifier
start_time iso8601 YYYY-MM-DD hh:mm:ss yes yes Date and time when the call session started
finish_time iso8601 YYYY-MM-DD hh:mm:ss yes Call session end time
finish_reason enum yes yes yes Reason for ending the call session. A list of possible causes is provided below
direction enum
  • in - Incoming;
  • out - Outgoing
yes yes yes Call session direction
cpn_region_id number yes yesyes Unique identifier of the region of the subscriber number
cpn_region_name string yes yes yes Name of the region of the subscriber number
cpn_country_name string yes yes yes Name of the country of the subscriber number
cpn_country_id string yes yes yes Unique identifier of the country of the subscriber number
properties string Callback forms may have a field with a comment (text). If the user leaves a comment (text) when generating a call back, it will be displayed in this field.
Script Operations
scenario_operations array yes no no List of all operations for all scenarios involved in call processing.
id number Unique identifier for the script operation
name string Script operation name
source enum
  • callapi - Call API Basic set
  • callapi_management_call - Call API Call management
  • callapi_informer_call - Call API Information call
  • callapi_scenario_call - Call API Call script
  • va - VATS call
  • call_tracking - Analytics
  • dynamic_call_tracking - Dynamic call tracking
  • faxout - Fax
  • sip - Outgoing from SIP
  • sitephone - Sitephone
  • lead - Lead Generator
  • retailcrm - Call from retailCRM
  • amocrm - Call from amoCRM
  • bitrix - Call from Bitrix24
  • auto_back_call_by_lost_call - Auto call back for missed calls
  • sip_trunk - Call from SIP trunk
  • facebook_ads - Calls from Social Network Ads
  • auto_back_call_by_offline_message - Automatic call back for requests
  • private_number - Verification call to add a client number from your personal account
  • auto_out_calls - Outgoing call
  • ivr_informer - Information from IVR
  • upload_calls - Call from an external system
  • progressive_call - Progressive
  • simple_dt - Simple dynamic call tracking
  • preserved_calls - Saved redirect
  • amocrm_extended_integration - Auto call back from CRM
  • zoho - Zoho
  • mytarget_ads - Calls from myTarget Ads
  • pipedrive - Pipedrive
  • hubspot - HubSpot
  • smartis - Calls from Smarties
  • partner_integration - Affiliate integration
  • vk_ads - Calls from VK Ads
  • omni_widget - Omnichannel widget
yes yes yes Call source
is_lost boolean yes yes yes Sign that the call is lost or successful
communication_number number yes yes For a VATS session, the VATS is always empty, this is now the ideology of the service
communication_page_url string no no no The URL of the page the visitor was on at the time of the call or the page of the visitor’s last interaction before the call.
contact_phone_number string yes yes The contact number from which the call was received in the case of an incoming call or the contact number to which the call was made in the case of an outgoing call.
communication_id number yes yes Unique identifier of the case
communication_type enum call yes Treatment type
wait_duration number yes yes The length of time a subscriber waits before the first conversation with an employee. Value in seconds.
total_wait_duration number yes yes The total duration of the subscriber's waiting time on the line. Takes into account all intervals when the subscriber did not talk to the employee. Value in seconds
lost_call_processing_duration number yes yes Duration of processing a missed call. It is counted from the moment of a missed conversation to the first successful one. Value in seconds
talk_duration number yes yes Conversation duration. It is counted from the moment of the first conversation between the subscriber and the employee until the start of post-processing. Value in seconds
clean_talk_duration number yes yes Net call duration. Takes into account only those intervals when the subscriber spoke with the employee. Value in seconds
total_duration number yes yes Call duration, value in seconds
postprocess_duration number yes Duration of post-processing, value in seconds
call_records array yes Unique identifier of the link to the recorded conversation. You can listen by calling a request in your browser: https://app.callgear.com/system/media/talk/{communication_id}/{уникальный индентификатор ссылки на записанный разговор}/
wav_call_records array yes Unique identifier of the link to the recorded conversation in wav format. You can listen by calling a request in the browser: https://app.callgear.com/system/media/wav/{communication_id}/{уникальный индентификатор ссылки на записанный разговор в формате wav}/
full_record_file_link string yes Link to full recording of the conversation. You can listen by calling a request in the browser: https://media.callgear.com/{communication_id}/{уникальный индентификатор ссылки на записанный разговор}
voice_mail_records array Unique identifier of the link to the left voice message. You can listen by calling a request in the browser: https://app.callgear.com/system/media/voice_mail/{communication_id}/{уникальный индентификатор ссылки на голосовое сообщение}/
virtual_phone_number string yes yes yes Virtual number
ua_client_id string Unique identifier in Universal Analytics
ym_client_id string Unique Yandex.Metrica user identifier
sale_date iso8601 YYYY-MM-DD hh:mm:ss yes yes Trade date
sale_cost number yes yes Transaction amount
is_transfer boolean true, false yes yes Was there a transfer during the call session
search_query string yes Search query
search_engine string yes Search engine name
referrer_domain string yes Referrer domain
referrer string yes Transition source
entrance_page string yes Login page
gclid string yes Google Click Identifier
yclid string yes Yandex Click Identifier
ymclid string Yandex Market Click Identifier
ef_id string yes Used to mark up links in the AdLense system
channel enum
  • display
  • paid
  • affiliate
  • messenger
  • social
  • email
  • organic
  • internal
  • recommendation
  • cashed
  • referral
  • direct
yes Channel.
Added tags
tags array yes Tags, see method "get.tags"
tag_name string Tag name
tag_id number Unique tag identifier
tag_change_time iso8601 YYYY-MM-DD hh:mm:ss Tag insertion time
tag_type enum auto, manual Tag type
tag_user_id number Unique identifier of the user who added the tag
tag_user_login string Login of the user who added the tag
tag_employee_id number Unique identifier of the employee who added the tag
tag_employee_full_name string Full name of the employee who added the tag
Employees who participated in the call
employees array yes Employees who participated in the call
employee_id number Unique employee identifier
employee_full_name string F.I.O. employee
is_answered boolean Indicator whether the employee picked up the phone or not
is_talked boolean Indicator whether the employee participated in the conversation or not
Last employee to respond
last_answered_employee_id number yes Unique identifier of the last employee who answered the phone
last_answered_employee_full_name string yes Full name of the last employee who answered the phone
last_answered_employee_rating number yes Rating of the last employee who spoke, which the subscriber gave after the call ended
First employee to respond
first_answered_employee_id number yes Unique identifier of the first employee who answered the phone first
first_answered_employee_full_name string yes F.I.O. the first employee who answered the phone first Last employee spoken
Last employee who spoke
last_talked_employee_id number yes Unique identifier of the last employee who spoke
last_talked_employee_full_name string yes Full name of the last employee who spoke
First employee to talk
first_talked_employee_id number yes Unique identifier of the first employee who spoke
first_talked_employee_full_name string yes Full name of the first employee who spoke
Operator
operator_phone_number string yes Number of the operator who answered the call
Script
scenario_name string yes Name of the scenario according to which the call processing began
scenario_id number yes yes Unique identifier of the scenario for which call processing began
Website
site_domain_name string yes Site address on the Internet. Without specifying the protocol - "http://" or "https://"
site_id number yes yes Unique site identifier
Advertising campaign
campaign_name string yes Advertising campaign name
campaign_id number yes yes Unique identifier of the advertising campaign
visit_other_campaign boolean true, false The flag shows whether the visitor (within the person) visited other advertising campaigns
auto_call_campaign_name string yes yes Name of outbound call campaign"
Visitor information
visitor_id number yes yes Unique visitor identifier
person_id number yes Unique person identifier
visitor_type enum New, Returned, Emptyyes yes Visitor type
visitor_session_id number yes Unique visitor session identifier
visits_count number yes Total number of visits by the visitor
visitor_first_campaign_id number yes Unique identifier of the first advertisement
visitor_first_campaign_name string yes Name of the first advertising campaign
visitor_city string yes Visitor city
visitor_region string yes Visitor region
visitor_country string yes Visitor country
visitor_device enum
  • desktop
  • mobile
  • tablet
  • other
yes yes User device
Visitor properties
visitor_custom_properties array yes Visitor properties that can be set using the JavaScript API [Comagic.setProperty method]
property_name string Name of the property to be assigned
property_value string Property value
Segments
segments array yes Segments
segment_id number Unique segment identifier
segment_name string Segment name
Call API
call_api_request_id number yes The unique identifier of the request to the API being requested.
call_api_external_id string yes A unique identifier that can be a call event with an external system.
Contact from address book
contact_id number yes Unique contact identifier
contact_full_name string yes Last name First name Middle name of contact
UTM tags
utm_source string yes Campaign source
utm_medium string yes Campaign Channel
utm_term string yes Campaign keyword
utm_content string yes Campaign content
utm_campaign string yes Campaign name
OS tags
openstat_ad string yes Ad ID
openstat_campaign string yes Advertising campaign ID
openstat_service string yes Identifier of the service providing the service
openstat_source string yes ID of the site, section, page, the corresponding advertisement was shown
Hit attributes
attributes array
  • first - First quality
  • through - End-to-end first quality
  • primary - Primary
  • secondary - Secondary
  • lost - Lost
  • target - Target
  • off-target - Not targeted
  • quality - Quality
  • rest - target repeated requests (requests made during the period of repeated requests configured for the site in the CallGear account).
yes Hit attributes
Extended UTM tags
eq_utm_source string yes Extended utm_source
eq_utm_medium string yes Extended utm_medium
eq_utm_term string yes Extended utm_term
eq_utm_content string yes Extended utm_content
eq_utm_campaign string yes Extended utm_campaign
eq_utm_referrer string yes Extended utm_referrer
eq_utm_expid string yes Extended utm_expid
Source information
source_id number yes yes Source ID (detailed).
source_name string yes yes Source (detailed). Source name
source_new string yes yes Source(new). Source group
channel_new string yes yes Channel(new). Source channel name
channel_code string yes yes Channel mnemonic
Parameters from external systems
ext_id string yes yes A unique call identifier in your system.

Reasons for ending a call session| Mnemonics | Description |

| :---------------------------------- | :---------------------------------------------------------------------------------- | | numb_not_exists | Virtual number not found | | incorrect_input | Invalid input | | numb_is_inactive | Virtual number is not active | | sitephone_is_not_configured | Websitephone is not configured | | app_is_inactive | Client deactivated | | numa_in_black_list | Blacklisted caller | | no_active_scenario | No active script found | | simple_forwarding_is_not_configured | Analytics: simple redirection is not configured | | site_not_exists | Site not found | | call_generator_is_not_configured | The lead generator is not configured | | add_cdr_timeout | Not defined | | success_finish | Not defined | | api_permission_denied | Access to Call API is denied | | api_ip_now_allowed | IP address not on the allowed list | | component_is_inactive | Component not active | | employees_not_exists | Employee not found | | not_enough_money | Insufficient funds | | platform_not_found | Contact Technical Support | | internal_error | Contact Technical Support | | incorrect_config | Invalid configuration | | communication_unavailable | Unavailable connection type | | subscriber_disconnects | The subscriber disconnected | | no_operation | No operation to process || scenario_not_found | Script not found | | transfer_disconnects | Disabling an employee during a transfer | | scenario_disconnects | Disabling an employee when running a script | | fax_session_done | Fax received | | no_resources | Client limit has been reached | | another_operator_answer | We reached another employee | | subscriber_busy | Subscriber is busy | | subscriber_not_responsive | The subscriber does not answer | | subscriber_number_problems | Problems with the subscriber's phone number. Contact technical support. | | operator_answer | We reached an employee | | locked_numb | Calls to this number are prohibited by security settings | | call_not_allowed_on_tp | The call is prohibited according to the tariff plan | | account_not_found | Personal account not found | | contract_not_found | Contract not found | | 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. | | timeout | The call time has expired | | operator_channels_busy | Out of available lines at the forwarding number | | 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 | | sip_offline | SIP line is not registered | | employee_inactive | Employee inactive | | employee_inactive_by_schedule | Employee is inactive according to schedule | | employee_phone_inactive | Employee number is inactive | | employee_phone_inactive_by_schedule | Employee number is inactive according to schedule | | action_interval_exceeded | The interval specified for the operation has been exceeded | | group_phone_inactive | Group number unavailable | | no_operator_confirmation | The employee did not confirm the call | | max_transition_count_exceeded | The maximum number of transitions for script operations has been reached | | disconnect_before_call_processing | Disconnect before call processing | | no_success_subscriber_call | Didn't get through to the subscriber | | no_success_operator_call | Didn't get through to the employee | | group_inactive_by_schedule | Group of employees is inactive according to schedule | | net_lock | The operator's network is blocked | | fmc_is_disabled | FMC service disabled | | fmc_is_locked | FMC line blocked | | processing_method_not_found | Processing method not found | | employee_without_phones | |The employee has no numbers | | group_without_phones | |There are no numbers in the employee group | | no_operator_cdr_found | No employee calls found | | in_call_not_allowed | Incoming calls are prohibited | | phone_protocol_not_allowed_by_status | Calls from this type of number are prohibited by 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 | | sip_trunk_is_locked | SIP trunk blocked | | numa_in_spam_list | Spam call | | numa_dnd_interval | Called recently | | limit_exceeded | Financial limit reached | | no_money | Insufficient funds | | out_call_not_allowed | Outgoing calls are prohibited | | out_call_not_allowed_by_status | Outgoing calls are prohibited by status | | external_call_not_allowed | External calls are prohibited | | external_call_not_allowed_by_status | External calls are prohibited by status | | internal_call_not_allowed | Internal calls are prohibited | | internal_call_not_allowed_by_status | Internal calls are prohibited by status | | call_enqueued | Call queued | | employee_status_auto_out_call | Employee in the status "Outgoing call" | | employee_status_available | Employee with "Available" status | | too_many_identical_incoming_calls | Too many identical incoming calls | | employee_auto_status_do_not_disturb | Employee in automatic Do Not Disturb status | | auto_out_calls_not_allowed_by_status | Outgoing calling is prohibited by status |

JSON request structure```json

{ "jsonrpc":"2.0", "id":"number", "method":"get.calls_report", "params":{ "access_token":"string", "user_id":"number", "offset":"number", "limit":"number", "date_from":"string", "date_till":"string", "filter":{

},
"sort":[
  {
    "field":"string",
    "order":"string"
  }
],
"fields":[
  "string"
]

} }

### JSON response structure```json
{
  "jsonrpc": "2.0",
  "id": "number",
  "result": {
    "metadata": {

    },
    "data": [
      {
        "id": "number",
        "start_time": "iso8601",
        "finish_time": "iso8601",
        "virtual_phone_number": "string",
        "is_transfer": "boolean",
        "finish_reason": "enum",
        "direction": "enum",
        "source": "enum",
        "communication_number": "number",
        "communication_page_url": "string",
        "communication_id": "number",
        "communication_type": "enum",
        "is_lost": "boolean",
        "cpn_region_id": "number",
        "cpn_region_name": "string",
                "cpn_country_name": "string",
                "cpn_country_id": "string",
        "wait_duration": "number",
        "total_wait_duration": "number",
        "lost_call_processing_duration" :"number",
        "talk_duration": "number",
        "clean_talk_duration": "number",
        "total_duration": "number",
        "postprocess_duration": "number",
        "ua_client_id": "string",
        "ym_client_id": "string",
        "sale_date": "iso8601",
        "sale_cost": "number",
        "search_query": "string",
        "search_engine": "string",
        "referrer_domain": "string",
        "referrer": "string",
        "entrance_page": "string",
        "gclid": "string",
        "yclid": "string",
        "ymclid": "string",
        "ef_id": "string",
        "channel": "enum",
        "site_id": "number",
        "site_domain_name": "string",
        "campaign_id": "number",
        "campaign_name": "string",
        "auto_call_campaign_name": "string",
        "visit_other_campaign": "boolean",
        "visitor_id": "number",
        "person_id": "number",
        "visitor_type": "enum",
        "visitor_session_id": "number",
        "visits_count": "number",
        "visitor_first_campaign_id": "number",
        "visitor_first_campaign_name": "string",
        "visitor_city": "string",
        "visitor_region": "string",
        "visitor_country": "string",
        "visitor_device": "enum",
        "last_answered_employee_id": "number",
        "last_answered_employee_full_name": "string",
        "last_answered_employee_rating": "number",
        "first_answered_employee_id": "number",
        "first_answered_employee_full_name": "string",
        "scenario_id": "number",
        "scenario_name": "string",
        "call_api_external_id": "string",
        "call_api_request_id": "number",
        "contact_phone_number": "string",
        "contact_full_name": "string",
        "contact_id": "number",
        "utm_source": "string",
        "utm_medium": "string",
        "utm_term": "string",
        "utm_content": "string",
        "utm_campaign": "string",
        "openstat_ad": "string",
        "openstat_campaign": "string",
        "openstat_service": "string",
        "openstat_source": "string",
        "eq_utm_source": "string",
        "eq_utm_medium": "string",
        "eq_utm_term": "string",
        "eq_utm_content": "string",
        "eq_utm_campaign": "string",
        "eq_utm_referrer": "string",
        "eq_utm_expid": "string",
        "attributes": [

        ],
        "call_records": [

        ],
        "voice_mail_records": [

        ],
        "tags": [
          {
            "tag_id": "number",
            "tag_name": "string",
            "tag_type": "enum",
            "tag_change_time": "iso8601",
            "tag_user_id": "number",
            "tag_user_login": "string",
            "tag_employee_id": "number",
            "tag_employee_full_name": "string"
          }
        ],
        "visitor_custom_properties": [
          {
            "property_name": "string",
            "property_value": "string"
          }
        ],
        "segments": [
          {
            "segment_id": "number",
            "segment_name": "string"
          }
        ],
        "employees": [
          {
            "employee_id": "number",
            "employee_full_name": "string",
            "is_answered": "boolean"
          }
        ],
        "operator_phone_number": "string",
        "scenario_operations": [
          {
            "name": "string",
            "id": "number"
          }
        ],
        "source_id": "number",
        "source_name": "string",
        "source_new": "string",
        "channel_new": "string",
        "channel_code": "string",
        "ext_id": "string",
        "properties": "string"
      }
    ]
  }
}

List of returned errors

See the section "List of errors for methods with the verb get"