Last Updated on : 2026-02-26 09:16:49download
Based on the device ID, query the chat history for the specified AI agent.
GET: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/history
| Parameter name | Type | IN | Required | Description |
|---|---|---|---|---|
| device_id | String | path | true | The ID of the specified device. |
| bind_role_type | Integer | query | true | The type of role to bind. Valid values:
role_id has a value, this parameter value must be passed. |
| role_id | String | query | true | The ID of the specified role. |
| gmt_end | Long | query | true | The end timestamp of the chat message. Chat messages sent before this time will be returned. |
| page_size | Integer | query | true | The number of items returned per page. Maximum value: 20. |
| Parameter name | Type | Description |
|---|---|---|
| result | List | The list of session records. |
Description of result
| Parameter name | Type | Description |
|---|---|---|
| gmt_create | Long | The timestamp when the chat is created. |
| answer | List | The list of answers. |
| question | List | The list of questions. |
| request_id | String | The ID of the session record. |
Description of question
| Parameter name | Type | Description |
|---|---|---|
| context | String | The message content. |
| type | String | The message type. |
Description of answer
| Parameter name | Type | Description |
|---|---|---|
| context | String | The message content. |
| type | String | The message type. |
GET: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/history
{
"device_id": "6c50600a0e15d1fb78h***",
"bind_role_type": 1,
"role_id": "94300***",
"gmt_end": 1753079987512,
"page_size": 20
}
{
"result": [
{
"gmt_create": 1753344939913,
"question": [
{
"type": "text",
"context": "My ***"
}
],
"answer": [
{
"type": "text",
"context": "You told me *** before"
}
],
"request_id": "ccbda733-e3d2-4ee3-bb19-d201-***"
}
],
"t": 1753707608368,
"success": true
}
For more information, see error code.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback