刪除元資料欄位
刪除元資料欄位
依 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 | 錯誤詳情。 |
