Receive all chat messages
| Method | get.chat_messages_report |
|---|---|
| Description | Receive all chat messages |
| 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" |
|
fields |
array | no | See "View of Returned Data" | |
sort |
array | no | See section "Sorting data" | |
chat_id |
number | yes, if there are no chat_ids or date_from and date_till |
Unique chat ID | |
chat_ids |
array | yes, if there is no chat_id or date_from and date_till |
List of unique chat IDs | |
date_from |
iso8601 | yes, if no chat_id or chat_ids | YYYY-MM-DD hh:mm:ss | Sampling start date. The maximum interval value should not exceed 30 days. Can be used together with the chat_id and chat_ids parameters. |
date_till |
iso8601 | yes, if no chat_id or chat_ids | YYYY-MM-DD hh:mm:ss | Sampling end date. The maximum interval value should not exceed 30 days. Can be used together with the chat_id and chat_ids parameters. |
Response parameters
| Name | Type | Valid values | Filtering | Sorting | Answer by default | Description |
|---|---|---|---|---|---|---|
id |
number | yes | yes | Unique message identifier | ||
chat_id |
number | yes | yes |
Unique chat ID, see
method "get.chats_report"
|
||
channel_id |
number | yes |
Unique identifier of the chat channel. Must be used in conjunction with a filter by date or chat_id |
|||
channel_type |
enum | comagicyandex.dialogsdataapiwhatsapptelegramvkontakte_groupsvibertelegram_privaterealty_yandexavitoauto_rufacebookoffline_messageinstagramwaba |
yes | yes | Channel type. Must be used in conjunction with a filter by date or chat_id |
|
date_time |
iso8601 | YYYY-MM-DD hh:mm:ss | yes | yes |
Date and time when it was sent
message All messages must be
in the order they were sent, i.e.
sorted by field
|
|
is_group_chat |
boolean | yes | Indicates whether the chat is a group chat | |||
visitor_id |
number | yes | Unique visitor ID | |||
text |
string | yes | Message text | |||
source |
enum | system - System;operator - Operator;visitor - Visitor;retention - Holding messages;autoinvite - Auto-invitation;form_text - Information collection form;chat_channel - Messenger;chatbot - Chat bot; |
yes | Message source | ||
resource |
object | yes | Information about the sent file in the message:size - file size in bytestype - file typefile_url - link to filefile_name - file namemime_type - media type |
|||
| Employee | ||||||
employee_id |
number | yes | yes | yes | Unique employee identifier | |
employee_full_name |
string | yes | Last name First name Patronymic of the employee | |||
JSON request structure```json
{ "jsonrpc":"2.0", "id":"number", "method":"get.chat_messages_report", "params":{ "access_token":"string", "chat_id":"number", "user_id":"number", "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",
"chat_id":"number",
"date_time":"iso8601",
"is_group_chat": "boolean",
"visitor_id": "number",
"text":"string",
"resource": {
"size": "number",
"type": "enum",
"file_url": "string",
"file_name": "string",
"mime_type": "string"
},
"source":"enum",
"employee_id":"number",
"employee_full_name":"string"
}
]
}
}
List of returned errors
See the section "List of errors for methods with the verb get"