Get Correlated Document
最新の更新:2024-08-20

Get Correlated Document

Gets the document data referenced by the Bot's answer.

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 Bot'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 Bot 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 Bot deleted
20055 API is forbidden
40127 Developer authentication failed