删除元数据字段
删除元数据字段
按 ID 批量删除元数据字段。系统预置字段不可删除。一次最多删除 50 个。ids 走逗号分隔的 URL 查询参数,非请求体。
请求方式
DELETE
调用地址
https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/field/delete
调用验证
详情参见 API 概述的鉴权方式说明。
请求
请求示例
curl -X DELETE 'https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/field/delete?ids=665f1c8a9b2e4d001a3f0001,665f1c8a9b2e4d001a3f0002' \
-H 'Authorization: Bearer ${API Key}'
curl -X DELETE 'https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/field/delete?ids=665f1c8a9b2e4d001a3f0001,665f1c8a9b2e4d001a3f0002' \
-H 'Authorization: Bearer ${API Key}'
此代码块在浮窗中显示
请求头
| 字段 | 类型 | 描述 |
|---|---|---|
| Authorization | Bearer ${API Key} | 使用 Authorization: Bearer ${API Key}进行调用验证,请在 API 密钥页面获取密钥作为 API Key。 |
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ids | String | 是 | 逗号分隔的字段 ID,一次最多 50 个。 |
响应
响应示例
{
"success_count": 1,
"failure_count": 2,
"results": [
{
"id": "665f1c8a9b2e4d001a3f0001",
"success": true
},
{
"id": "665f1c8a9b2e4d001a3f0003",
"success": false,
"error_message": "field not found"
},
{
"id": "665f1c8a9b2e4d001a3f0004",
"success": false,
"error_message": "predefined field cannot be deleted"
}
]
}
{
"success_count": 1,
"failure_count": 2,
"results": [
{
"id": "665f1c8a9b2e4d001a3f0001",
"success": true
},
{
"id": "665f1c8a9b2e4d001a3f0003",
"success": false,
"error_message": "field not found"
},
{
"id": "665f1c8a9b2e4d001a3f0004",
"success": false,
"error_message": "predefined field cannot be deleted"
}
]
}
此代码块在浮窗中显示
成功响应
| 字段 | 类型 | 说明 |
|---|---|---|
| success_count | Integer | 删除成功的字段数。 |
| failure_count | Integer | 删除失败的字段数。 |
| results | Array<Object> | 逐 ID 结果。 |
| id | String | 字段 ID。 |
| success | Boolean | 是否删除成功。 |
| error_message | String | 失败原因:field not found(字段不存在) / predefined field cannot be deleted(预置字段不可删除)。 |
失败响应
| 字段 | 类型 | 描述 |
|---|---|---|
| code | Integer | 错误码。 |
| message | String | 错误详情。 |
