全部產品
Search
文件中心

AI Coding Assistant Lingma:大量新增知識庫檔案

更新時間:Jul 01, 2025

通過 OpenAPI 大量新增知識庫檔案。

適用版本

企業專屬版

服務存取點

擷取服務存取點,替換 API 請求文法中的 {domain}

授權資訊

產品

資源

要求的權限

靈碼

知識庫檔案

讀寫

請求文法

POST https://{domain}/oapi/v1/lingma/organizations/{organizationId}/knowledgeBases/{kbId}/files/batchUpload

請求說明

刪除知識庫檔案

curl -X 'POST' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/lingma/organizations/99d1****71d4/knowledgeBases/1f23ea7459c45e1f04c3****/files/batchUpload' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --form 'files=@"/D:/lingma/file1.md"' \
  --form 'files=@"/D:/lingma/file2.md"'

要求標頭(Headers)

x-yunxiao-token string (必選)

個人存取權杖。您可參考個人存取權杖擷取。

樣本:pt-0fh3****0fbG_35af****0484。

請求參數

organizationId string (必選)

組織 ID。您可前往組織管理背景基本資料頁面擷取

kbId string (必選)

知識庫 id。您可通過ListKnowledgeBases介面擷取。

files array[File] (必選)

待上傳的真實檔案清單。

  • 支援的檔案格式為:pdf、csv、docx、txt、markdown。

  • 每次最多上傳10 檔案,檔案大小不超過10 MB。

  • 檔案名稱不超過 200 個字元。

返回參數

返回樣本

[
    {
        "fileId": "aefb0ce3924fc778260cc274",
        "operateUserId": "bf2fce4f-7048-4017-a734-1c346e68****",
        "success": true
    },
    {
        "fileId": "51b47ec207ed09ee2ee288a5",
        "operateUserId": "bf2fce4f-7048-4017-a734-1c346e68****",
        "success": true
    }
]

fileId string

檔案 ID。

operateUserId string

操作者使用者識別碼。

success boolean

是否上傳成功。

  • true:成功。

  • false:失敗。

failedMessage string

失敗的原因,如果成功則不返回該參數。

錯誤碼

訪問錯誤碼中心查看 API 相關錯誤碼。