删除知识库文件

通过 OpenAPI 删除通义灵码知识库文件。

适用版本

企业专属版、企业标准版

服务接入点

获取服务接入点,替换 API 请求语法中的 {domain}

授权信息

产品

资源

所需权限

通义灵码

知识库文件

读写

请求语法

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

请求说明

企业标准版

删除知识库文件

curl -X 'DELETE' \
  'https://openapi-rdc.aliyuncs.com/oapi/v1/lingma/organizations/99d1****71d4/knowledgeBases/1f23ea7459c45e1f04c3****/files' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
         "fileIds": ["6757a6066f5d069ee155****", "4a1f388928e4a7375dcb****"]
    }'

企业专属版

删除知识库文件

curl -X 'DELETE' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/lingma/organizations/99d1****71d4/knowledgeBases/1f23ea7459c45e1f04c3****/files' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
         "fileIds": ["6757a6066f5d069ee155****", "4a1f388928e4a7375dcb****"]
    }'

请求头(Headers)

x-yunxiao-token string (必选)

个人访问令牌。您可参考个人访问令牌获取。

示例:pt-0fh3****0fbG_35af****0484。

请求参数

organizationId string (必选)

组织 ID。您可前往组织管理后台的基本信息页面获取

kbId string (必选)

知识库 ID。您可通过ListKnowledgeBases接口获取。

fileIds array[string] (必选)

待删除的文件列表。您可通过ListKbFiles接口获取。

返回参数

返回示例

{
    "failedFiles": [
        {
            "failedMessage": "文件当前状态不允许此操作, 文件id: 6757a6066f5d069ee155f2f4, 状态: DELETED。",
            "fileId": "6757a6066f5d069ee155****",
            "operateUserId": "bf2fce4f-7048-4017-a734-1c346e68****",
            "success": false
        }
    ],
    "successFiles": [
        {
            "fileId": "4a1f388928e4a7375dcb****",
            "operateUserId": "bf2fce4f-7048-4017-a734-1c346e68****",
            "success": true
        }
    ]
}

failedFiles array

删除失败的文件。

属性

failedMessage string

失败信息。

fileId string

文件 ID。

operateUserId string

操作者用户 ID。

success boolean

删除状态,值为 false

successFiles array

删除成功的文件。

属性

fileId string

文件 ID。

operateUserId string

操作者用户 ID。

success boolean

删除状态,值为 true

错误码

访问错误码中心查看 API 相关错误码。