Delete knowledge base files

Updated at:

Deletes one or more files from a Qoder CN knowledge base.

Important

The new Qoder CN documentation site is now available. Content on this site may not reflect the latest product features and changes. Visit docs.qoder.cn for the latest product documentation.

Supported editions

Enterprise Dedicated Edition, Enterprise Standard Edition

Service endpoints

Get the service endpoint and replace {domain} in the API request syntax with your endpoint.

Authorization

Product

Resource

Permissions

Qoder CN

knowledge base file

Read and write

Request syntax

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

Request

Standard enterprise edition

Delete knowledge base 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****"]
    }'

Enterprise dedicated edition

Delete knowledge base files

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****"]
    }'

Request headers

x-yunxiao-token string (Required)

The access token. See Access token for details.

Example: pt-0fh3****0fbG_35af****0484.

Request parameters

organizationIdstring Required

The ID of the organization. You can find this ID on the 4. Getting the Organization ID.

kbIdstring Required

The ID of the knowledge base. To get this ID, call the ListKnowledgeBases operation.

fileIdsarray[string] Required

A list of file IDs to delete. To get file IDs, call the ListKbFiles - List knowledge base files operation.

Response parameters

Response example

{
    "failedFiles": [
        {
            "failedMessage": "This operation is not permitted on the file in its current state. File ID: 6757a6066f5d069ee155f2f4, Status: DELETED.",
            "fileId": "6757a6066f5d069ee155****",
            "operateUserId": "bf2fce4f-7048-4017-a734-1c346e68****",
            "success": false
        }
    ],
    "successFiles": [
        {
            "fileId": "4a1f388928e4a7375dcb****",
            "operateUserId": "bf2fce4f-7048-4017-a734-1c346e68****",
            "success": true
        }
    ]
}

failedFilesarray

A list of files that the operation failed to delete.

Properties

failedMessagestring

The error message that explains why the deletion failed for this file.

fileIdstring

The file ID.

operateUserIdstring

The user ID of the operator.

successboolean

Indicates the result of the deletion. The value is always false for files in this list.

successFilesarray

A list of files that were successfully deleted.

Properties

fileIdstring

The file ID.

operateUserIdstring

The user ID of the operator.

successboolean

Indicates the result of the deletion. The value is always true for files in this list.

Error codes

For more information, see Error code center.