Get Correlated Document
Get Correlated Document
Retrieves the referenced document data used by the Agent when responding to a message, based on the input message_id
. The response includes information such as document IDs, names, and source URLs of the referenced materials.
Request Method
POST
Request URL
https://api-${endpoint}.gptbots.ai/v1/bot/data/references
Request Authentication
See Overview for authentication details.
Request
Request Example
curl -X POST 'https://api-${endpoint}.gptbots.ai/v1/bot/data/references' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
"message_id": "xxxxx"
}'
curl -X POST 'https://api-${endpoint}.gptbots.ai/v1/bot/data/references' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
"message_id": "xxxxx"
}'
บล็อกโค้ดนี้ในหน้าต่างลอย
Request Headers
Field | Type | Description |
---|---|---|
Authorization | Bearer ${token} | UseAuthorization: Bearer ${token} for authentication. Get the key from the API Keys page as token. |
Content-Type | application/json | Data type, value is application/json. |
Request Body
Field | Type | Required | Description |
---|---|---|---|
message_id | string | true | Message ID of Agent's response. |
Response
Response Example
{
"code": 0,
"msg": "success",
"data": {
"conversationId": "65dc320df07244300b25b993",
"questionId": "65dc323ef07244300b25b9c5",
"answerId": "65dc323ef07244300b25b9c6",
"refDoc": [
{
"dataId": "65dc3234f07244300b25b9b9",
"dataName": "中国的历史",
"sourceUrl": "https://www.example.com/chinese-history"
}
]
}
}
{
"code": 0,
"msg": "success",
"data": {
"conversationId": "65dc320df07244300b25b993",
"questionId": "65dc323ef07244300b25b9c5",
"answerId": "65dc323ef07244300b25b9c6",
"refDoc": [
{
"dataId": "65dc3234f07244300b25b9b9",
"dataName": "中国的历史",
"sourceUrl": "https://www.example.com/chinese-history"
}
]
}
}
บล็อกโค้ดนี้ในหน้าต่างลอย
Suceess Response
Field | Type | Description |
---|---|---|
conversationId | string | Conversation ID |
questionId | string | Message ID of user question |
answerId | string | Message ID of Agent response |
refDoc | JSON Array | Referenced Document Data |
dataId | string | Document ID |
dataName | string | Document Name |
sourceUrl | string | Document source URL |
Failure Response
Field | Type | Description |
---|---|---|
code | int | Error code. |
msg | string | Error details. |
Error Codes
Code | Message |
---|---|
40000 | Invalid parameter |
40379 | Credit not enough |
40378 | Agent deleted |
20055 | API is forbidden |
40127 | Developer authentication failed |