logo
การพัฒนา
ค้นหา
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.gptbots.ai/v1/bot/data/references

Request Authentication

See Overview for authentication details.

Request

Request Example

curl -X POST -H 'Authorization: Bearer your_apikey' -H 'Content-Type: application/json' -d '{"message_id": "xxxxx"}' "https://api.gptbots.ai/v1/bot/data/references"
                      
                      curl -X POST 
    -H 'Authorization: Bearer your_apikey' 		
    -H 'Content-Type: application/json'
    -d '{"message_id": "xxxxx"}'
    "https://api.gptbots.ai/v1/bot/data/references"

                    
บล็อกโค้ดนี้ในหน้าต่างลอย

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, set to 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