Query External Chat Records
Query the chat records of an external chat conversation.
Request URL
GET {base_url}/{api_path}/external_chat_logs/get?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| cnv_id | Yes | String | The unique ID of an external chat conversation. Note: You
can query the conversation ID using the Query External Chat Log List interface. |
| page | No | Integer | Define which page is displayed. |
| page_size | No | Integer | Define how many records per page. |
| order_by | No | String | Define the display order. Valid value:
|
| sort_by | No | String | Define the sorting field. Valid value:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| record_list | Array<External_Chat_Record> | The list of chat records. |
| total_number | Integer | The total number of chat records. |
- External_Chat_Record
-
Parameter Type Description id Integer The unique ID of the chat record. cnv_id Integer The ID of the conversation to which the chat record belongs. time String The time when the message was sent. from Object<External_Chat_Participant> The sender of the message. to Object<External_Chat_Participant> The recipient of the message. type String The type of the chat record. system: A system message.out: An outgoing message.in: An incoming message.failed: A failed message.
msg_body String The message content. msg_kind Integer The kind of the message. msg_type Integer The type of the message. msg_param String The message parameters. msg_expand_param String The extended message parameters. msg_files String The files attached to the message. tag String The message tag.
- External_Chat_Participant
-
Parameter Type Description type String The type of participant. extension: The participant is an extension.queue: The participant is a queue.external: The participant is an external contact.
name String The name of the participant. ext_num String The extension number of the participant. external_num String The external number of the participant. is_deleted Boolean Whether the participant has been deleted. true: The participant has been deleted.false: The participant has not been deleted.
Example
Request example
GET /openapi/v1.0/external_chat_logs/get?cnv_id=15&page=1&page_size=5&access_token=xVx9wX2B38gSD0C2o4y9b9bd5QOPz2MK HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"total_number": 2,
"record_list": [
{
"id": 72,
"cnv_id": 15,
"time": "2026/08/06 10:50:30",
"from": {
"type": "extension",
"name": "Sarah",
"ext_num": "3200"
},
"to": {
"type": "external",
"external_num": "+12345678"
},
"type": "failed",
"msg_body": "You're very welcome, Daniel. Have a great day!"
},
{
"id": 44,
"cnv_id": 15,
"time": "2026/07/21 13:57:25",
"from": {
"type": "extension",
"name": "Sarah",
"ext_num": "3200"
},
"to": {
"type": "external",
"external_num": "+12345678"
},
"type": "failed",
"msg_body": "Hi"
}
]
}