Getting information about chats
| Method | get.chats_report |
|---|---|
| Description | Getting information about chats |
| 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 agentTo 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 |
Response parameters
| Name | Type | Valid values | Filtering | Sorting | Default response | Description |
|---|---|---|---|---|---|---|
id |
number | yes | yes | Unique chat identifier. All
chat messages can be received
using the "get.chat_messages_report" | method
||
status |
enum |
new - the chat does not have an employee (not hired) and there is no reason to end the chat;active - the employee accepted the chat and did not end it (there is no reason to end the chat);lost - there is a reason for ending the chat and no employee took the chat to work OR - the reason for ending the chat is visitor_disconnected (the visitor left) OR - the reason for ending the chat is closed_by_timeout (ended by timeout) or closed_by_operator (closed by the operator) AND the number of operator messages = 0;succeed - any private chat with two-way correspondence;refused - any private chat where there are messages from the operator or auto-invitation, but there are 0 messages from the visitor;
|
yes | yes | yes | Chat status |
initiator |
enum | operator - Operator;visitor - Visitor;autoinvite - Auto-invitation;chat_channel - Messenger;chatbot - Chat bot |
yes | yes | yes | Chat initiator |
date_time |
iso8601 | YYYY-MM-DD hh:mm:ss | yes | yes | Date and time of chat start | |
duration |
string | yes | yes | yes | Chat duration. Value in seconds | |
answer_time |
number | yes | yes | yes | Operator response time. Value in seconds | |
communication_number |
number | yes | yes | Case number. Calculated in within the person. | ||
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. | |
communication_id |
number | yes | yes | Unique case number | ||
communication_type |
enum | chat |
Treatment type | |||
chat_ad_url |
string | yes | Link to ad from client request | |||
chat_channel_id |
number | yes |
Unique identifier of the chat channel. Must be used in conjunction with a filter by date or chat_id |
|||
chat_channel_type |
enum | comagicyandex.dialogsdataapiwhatsapptelegramvkontakte_groupsvibertelegram_privaterealty_yandexavitoauto_rufacebookoffline_messageinstagramsmsemailcianmax_bottamtam_botmaxsms_mass_messaging_uaesms_mass_messaging_internationalwaba |
yes | yes | Channel type. Must be used in conjunction with a filter by date or chat_id |
|
chat_channel_name |
string | Channel name | ||||
chat_user_id |
string | yes | yes | User_id from messengers | ||
chat_username |
string | yes | yes | Username (nickname) from messengers | ||
messages_count |
number | Number of messages in chat | ||||
ua_client_id |
string | Unique identifier in Universal Analytics | ||||
ym_client_id |
string | Unique Yandex.Metrica user identifier | ||||
sale_date |
iso8601 | YYYY-DD-MM hh:mm:ss | yes | yes | Trade date | |
sale_cost |
number | yes | yes | Transaction amount | ||
is_group_chat |
boolean | yes | Indicates whether the chat is a group chat | |||
is_transfer |
boolean | yes | Whether the chat was transferred to another employee | |||
release_cause |
enum |
closed_by_timeout
invite_rejected
closed_by_operator
closed_by_visitor
visitor_banned
external_window_closed
visitor_disconnected
visitor_session_expired
closed_by_scenario
room_removed
channel_removed
|
yes | yes | Reason for ending the chat | |
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 context management system AdLense advertising | |||
channel |
enum |
|
yes | Channel. | ||
| Employee who accepted the chat | ||||||
employee_id |
number | yes | yes | yes | Unique identifier employee | |
employee_full_name |
string | yes | Last Name First Name of Employee | |||
employee_raiting |
number | yes | Operator rating set visitor | |||
employee_messages_count |
number | Number of operator messages per chat | ||||
| Added tags | ||||||
tags |
array | yes | Tags, see method "get.tags" |
|||
tag_id |
number | Unique tag identifier | ||||
tag_name |
string | Tag name | ||||
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 the user who added the tag | ||||
tag_user_login |
string | Login of the user who added the tag | ||||
tag_employee_id |
number | Unique identifier the employee who added the tag | ||||
tag_employee_full_name |
string | Full name of the employee who entered tag | ||||
| Website | ||||||
site_id |
number | yes | yes | yes | Unique site identifier | |
site_domain_name |
string | yes | Site address on the Internet. Without indication
protocol - "http://" or "https://" |
|||
| Advertising campaign | ||||||
campaign_id |
number | yes | yes | yes | Unique advertising identifier campaigns | |
campaign_name |
string | yes | Advertising campaign name | |||
visit_other_campaign |
boolean | The flag shows whether you have visited visitor (within a person) by other advertising campaigns | ||||
| Visitor information | ||||||
visitor_phone_number |
number | yes | yes | Visitor phone number left in chat | ||
visitor_id |
number | yes | yes | yes | Unique identifier visitor | |
visitor_ids |
array | yes | Unique identifiers visitors who participated in the group chat | |||
person_id |
number | yes | yes | Unique person identifier | ||
visitor_type |
enum | New, Returned, Not filled | yes | yes | Visitor type | |
visitor_session_id |
number | yes | yes | Unique visitor session identifier, see "get.visitor_sessions_report" |
||
visits_count |
number | yes | Total number of visits visitor | |||
visitor_first_campaign_id |
number | yes | Unique identifier of the first advertising campaign. | |||
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 |
|
||||
visitor_profile_url |
string | yes | Link to visitor profile | yes | yes | Visitor device |
| Visitor properties | ||||||
visitor_custom_properties |
array | yes |
Visitor properties that can
be asked through your personal account
or using the JavaScript API [method
Comagic.setProperty(name, value);]
|
|||
property_name |
string | The name of the property that should be assigned to visitor | ||||
property_value |
string | Property value | ||||
| Segments | ||||||
segments |
array | yes | Segments | |||
segment_id |
number | Unique segment identifier | ||||
segment_name |
string | Segment name | ||||
| 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 | Advertising ID announcements | |||
openstat_campaign |
string | yes | Advertising campaign ID | |||
openstat_service |
string | yes | Service ID, service provider | |||
openstat_source |
string | yes | Identifier of the site, section, pages, places on the page, on which was shown relevant advertising announcement | |||
| Hit attributes | ||||||
attributes |
array |
|
yes | Case 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 | ||
source_name |
string | yes | yes | Source. Source name | ||
source_new |
string | yes | yes | Source group | ||
channel_new |
string | yes | yes | Channel(new). Source channel name | ||
channel_code |
string | yes | yes | Channel mnemonic | ||
ext_id |
string | yes | yes | Unique identifier for the chat on your system. | ||
JSON request structure```json
{ "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 response structure```json
{
"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_ad_url":"sting",
"chat_user_id":"sting",
"chat_username":"sting",
"chat_channel_id": "number",
"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_group_chat":"boolean",
"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",
"visitor_ids":"array",
"visitor_phone_number":"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",
"visitor_profile_url":"string",
"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"
}
],
"source_id": "number",
"source_name": "string",
"source_new": "string",
"channel_new": "string",
"channel_code": "string",
"ext_id": "string"
}
]
}
}
List of returned errors
See the section "List of errors for methods with the verb get"