logo
開發者文件
搜尋
取得文件清單

取得文件清單

取得 Agent 知識庫中的文件清單。

請求方法

GET

請求 URL

https://api-${endpoint}.gptbots.ai/v1/bot/doc/query/page

請求驗證

請參閱概述以瞭解驗證詳情。

要求

請求範例

curl -X GET 'https://api.gptbots.ai/v1/bot/doc/query/page?page=1&page_size=10&knowledge_base_id=67457fea6f658672d6482542' \ -H 'Authorization: Bearer ${API Key}'
                      
                      curl -X GET 'https://api.gptbots.ai/v1/bot/doc/query/page?page=1&page_size=10&knowledge_base_id=67457fea6f658672d6482542' \
-H 'Authorization: Bearer ${API Key}'

                    
此代碼塊在浮窗中顯示

請求標頭

欄位 類型 描述
Authorization Bearer ${API Key} 請使用 Authorization: Bearer ${API Key} 進行驗證。請從 API Key 頁面取得 API 密鑰。

請求參數

欄位 類型 必填 描述
knowledge_base_id String 知識庫的 ID。
page Integer 頁碼,起始值為 1。
page_size Integer 每頁文件數量,範圍介於 10 至 100 之間。

回應

回應範例

{ "list": [ { "id": "xxxxxx", "name": "My Doc", "format": "pdf", "source_url": "https://gptbots.ai/article_1.pdf", "status": "ACTIVE", "chunk": 100, "token": 1000000, "char_count": 10000000, "create_time": 1699843200, "update_time": 1699843200, "creator_id": "xxxxxx", "creator_email": "johnlee@gptbots.ai" }, { "id": "xxxxxx", "name": "My Doc 2", "format": "txt", "source_url": "https://gptbots.ai/article_2.html", "status": "ACTIVE", "chunk": 100, "token": 1000000, "char_count": 10000000, "create_time": 1699843200, "update_time": 1699843200, "creator_id": "xxxxxx", "creator_email": "johnlee@gptbots.ai" } ], "total": 100 }
                      
                      {
    "list": [
        {
            "id": "xxxxxx",
            "name": "My Doc",
            "format": "pdf",
            "source_url": "https://gptbots.ai/article_1.pdf",
            "status": "ACTIVE",
            "chunk": 100,
            "token": 1000000,
            "char_count": 10000000,
            "create_time": 1699843200,
            "update_time": 1699843200,
            "creator_id": "xxxxxx",
            "creator_email": "johnlee@gptbots.ai"
        },
        {
            "id": "xxxxxx",
            "name": "My Doc 2",
            "format": "txt",
            "source_url": "https://gptbots.ai/article_2.html",
            "status": "ACTIVE",
            "chunk": 100,
            "token": 1000000,
            "char_count": 10000000,
            "create_time": 1699843200,
            "update_time": 1699843200,
            "creator_id": "xxxxxx",
            "creator_email": "johnlee@gptbots.ai"
        }
    ],
    "total": 100
}

                    
此代碼塊在浮窗中顯示

成功回應

欄位名稱 類型 描述
list Array<Object> 文件清單。
id String 文件 ID。
name String 文件名稱。
format String 文件格式。
source_url String 文件來源 URL。
status String 文件狀態。
chunk Integer 文件中的知識區塊數量。
token Integer 文件中的 Token 數量。
char_count Integer 文件中的字元數量。
create_time Long 文件建立時間,時間戳格式。
update_time Long 文件更新時間,時間戳格式。
creator_id String 文件建立者的 ID。
creator_email String 文件建立者的電子郵件。
total Integer 總文件數量。

失敗回應

欄位 類型 描述
code Int 錯誤代碼。
message String 錯誤訊息內容。