檔案上傳知識庫

檔案文件串接

建議請先閱讀上一章的「檔案上傳」

檔案上傳

Endpoint

POST https://api.maiagent.ai/api/v1/chatbots/{chatbot_id}/files/

說明

上傳完成後,將檔案相關資訊提交至伺服器進行記錄。

請求參數

參數名稱
型別
必填
說明

files

array

包含檔案資訊的陣列

files[].file

string

檔案在雲端儲存的路徑

files[].filename

string

使用者希望保存的檔案名稱

範例請求

curl --location 'https://api.maiagent.ai/api/v1/chatbots/484a07fe-b401-4a32-9077-ddaae0c5e862/files/' \
--header 'Authorization: Api-Key ' \
--header 'Content-Type: application/json' \
--data '{
    "files": [
        {
            "file": "media/chatbots/chatbot-file/d83c88aa-3874-49a6-b01e-1948ae48b747.xlsx",
            "filename": "Products_example.xlsx"
        }
    ]
}'

回應範例

[
  {
    "id": "19ed09f0-a791-42a5-841f-c44faad2ef8b",
    "filename": "Products_example.xlsx",
    "file": "https://whizchat-media-prod-django.playma.app/media/chatbots/chatbot-file/d83c88aa-3874-49a6-b01e-1948ae48b747.xlsx",
    "fileType": "csv",
    "size": 582,
    "status": "initial",
    "document": null,
    "createdAt": "1728375369000"
  }
]

Last updated

Was this helpful?