删除知识库文档
更新时间:2025-02-18
接口描述
该接口用于删除知识库中的指定文档。
权限说明
Authorization需要填写密钥。
接口定义
Path | /v2/knowledgeBase?Action=DeleteDocument |
---|---|
Method | POST |
Content-Type | application/json |
Authorization | 请求签名(Bearer <AppBuilder API Key>) |
请求结构
Plain Text
1POST /v2/knowledgeBase?Action=DeleteDocument HTTP/1.1
2HOST: qianfan.baidubce.com
3Authorization: Bearer <AppBuilder API Key>
4{
5 "knowledgeBaseId": "知识库id",
6 "documentId": "文档id",
7}
请求头域
除公共头域外,无其它特殊头域。
请求参数
字段 | 类型 | 是否必须 | 说明 |
---|---|---|---|
knowledgeBaseId | string | 是 | 知识库ID |
documentId | string | 是 | 文档ID |
响应头域
除公共头域外,无其它特殊头域。
响应参数
字段 | 类型 | 必然存在 | 说明 |
---|---|---|---|
requestId | string | 是 | requestId |
请求curl 示例
Plain Text
1curl --location 'https://qianfan.baidubce.com/v2/knowledgeBase?Action=DeleteDocument' \
2--header 'Authorization: Bearer <AppBuilder API Key>' \
3--header 'Content-Type: application/json' \
4--data '{
5 "knowledgeBaseId": "83110635-1e0c-49ef-b1aa-ab669dc5e82f",
6 "documentId" : "7f295182-d968-416f-a8df-b69de7c2e750"
7}'
正确响应示例
Plain Text
1HTTP/1.1 200 OK
2{
3 "requestId": "355a4f4e-a6d8-4dec-b840-7075030c6d22"
4}
错误响应示例
Plain Text
1HTTP/1.1 401
2{
3 "requestId": "ae2225f7-1c2e-427a-a1ad-5413b762957d",
4 "code": "PermissionDeniedError",
5 "message": "没有权限"
6}