Skip to content

Get chats report

Getting information about chats

Method get.chats_report
Description Getting information about chats
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 values Filtering Sorting Default reply Description
id number yes yes Chat unique ID. You can get all the messages from a chat by using the method "get.chat_messages_report"
status enum lost - Lost; succeed - Succeed;
refused - Refused
yes yes yes Chat status
initiator enum Visitor, Operator, Auto invite yes yes yes Chat initiator
date_time iso8601 YYYY-MM-DD hh:mm:ss yes yes Time and sate when chat started
duration string yes yes yes Chat duration. Value is in seconds
answer_time number yes yes yes Operator's answer time. Value is in seconds
communication_number number yes yes Communication number. Calculated within a person.
communication_page_url string no no no URL of the webpage where a visitor was at the time of communication or the page of the last interaction with a visitor before comminication.
communication_id number yes yes Communication unique ID
communication_type enum chat Communication type
chat_channel_type enum callgear
yandex.dialogs
dataapi
yes yes Channel type
chat_channel_name string Channel name
messages_count number Messages count in a chat
ua_client_id string Unique ID in Universal Analytics
ym_client_id string User ID in Yandex.Metrika
sale_date iso8601 YYYY-DD-MM hh:mm:ss yes yes Sale date
sale_cost number yes yes Sale cost
is_transfer boolean yes Chat was transferred to another employee or not
release_cause enum closed_by_timeout invite_rejected closed_by_operator closed_by_visitor visitor_banned external_window_closed visitor_disconnected visitor_session_expired yes yes Why chat ended
search_query string yes Search query
search_engine string yes Search engine name
referrer_domain string yes Referrer domain
referrer string yes Referral source
entrance_page string yes Entrance 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 contextual management system AdLense
channel enum
  • display
  • paid
  • affiliate
  • messenger
  • social
  • email
  • organic
  • internal
  • recommendation
  • cashed
  • referral
  • direct
yes Channel.
Employee that accepted a chat
employee_id number yes yes yes Employee unique ID
employee_full_name string yes Employee full name
employee_raiting number yes Operator rating from a visitor
employee_messages_count number Number of operator messages in a chat
Using tags
tags array yes Tags, refer to the method "get.tags"
tag_id number Tag unique ID
tag_name string Tag name
tag_change_time iso8601 YYYY-MM-DD hh:mm:ss Time when a tag was used
tag_type enum auto, manual Tag type
tag_user_id number Unique ID of a user, who used a tag
tag_user_login string Login of a user, who used a tag
tag_employee_id number Unique ID of an employee, who used a tag
tag_employee_full_name string Full name of an employee, who used a tag
Website
site_id number yes yes yes Website unique ID
site_domain_name string yes Website address on the internet. Without protocol - "http://" or "https://"
Advertising campaign
campaign_id number yes yes yes Advertising campaign unique ID
campaign_name string yes Advertising campaign name
visit_other_campaign boolean Flag that shows whether or not a visitor visited website from other advertising campaigns (within person)
Information about visitor
visitor_id number yes yes yes Visitor unique ID
person_id number yes yes Person unique ID
visitor_type enum New, Returned, Not filled in yes yes Visitor type
visitor_session_id number yes yes Visitor session unique ID, refer to "get.visitor_sessions_report"
visits_count number yes Total visits count
visitor_first_campaign_id number yes First advertising campaign ID
visitor_first_campaign_name string yes First advertising campaign name
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 Visitor device
Visitor properties
visitor_custom_properties array yes Visitor properties that can be set in the client area or using JavaScript API [method CallGear.setProperty(name, value);]
property_name string Name of a property that's to be assigned to a visitor
property_value string Property value
Segments
segments array yes Segments
segment_id number Segment unique ID
segment_name string Segment name
UTM tags
utm_source string yes Campaign source
utm_medium string yes Campaign channel
utm_term string yes Campaign key word
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 Service provider ID
openstat_source string yes ID of a site, a section, a page, or a place on the page where an ad was shown
Communication attributes
attributes array
  • first - First quality
  • through - Through first quality
  • primary - Primary
  • secondary - Secondary
  • lost - Lost
  • target - Target
  • off-target - Off target
  • quality - Quality
  • rest - Recurring target communications (communications, happened during a second communication, set for a website in CallGear client area).
yes Communication attributes
Expanded UTM tags
eq_utm_source string yes Expanded utm_source
eq_utm_medium string yes Expanded utm_medium
eq_utm_term string yes Expanded utm_term
eq_utm_content string yes Expanded utm_content
eq_utm_campaign string yes Expanded utm_campaign
eq_utm_referrer string yes Expanded utm_referrer
eq_utm_expid string yes Expanded utm_expid

JSON request structure

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

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

JSON reply structure

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

    },
    "data":[
      {
        "id":"number",
        "status":"enum",
        "initiator":"enum",
        "date_time":"iso8601",
        "duration":"string",
        "answer_time":"number",
        "communication_number":"number",
        "communication_page_url": "string",
        "communication_id":"number",
        "communication_type":"enum",
        "chat_channel_type": "enum",
        "chat_channel_name": "string",
        "messages_count":"number",
        "ua_client_id":"string",
        "ym_client_id": "string",
        "sale_date":"iso8601",
        "sale_cost":"number",
        "is_transfer":"boolean",
        "release_cause":"enum",
        "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",
        "employee_id":"number",
        "employee_full_name":"string",
        "employee_messages_count":"number",
        "employee_raiting":"number",
        "site_id":"number",
        "site_domain_name":"string",
        "campaign_id":"number",
        "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",
        "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":[

        ],
        "visitor_custom_properties":[
          {
            "property_name":"string",
            "property_value":"string"
          }
        ],
        "segments":[
          {
            "segment_id":"number",
            "segment_name":"string"
          }
        ],
        "tags":[
          {
            "tag_id":"number",
            "tag_name":"string",
            "tag_type":"enum",
            "tag_change_time":"iso8601",
            "tag_user_login":"string",
            "tag_user_id":"number",
            "tag_employee_id":"number",
            "tag_employee_full_name":"string"
          }
        ]
      }
    ]
  }
}

List of returning errors

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