ลบฟิลด์ข้อมูลเมตา
ลบฟิลด์ข้อมูลเมตา
ลบฟิลด์ข้อมูลเมตาแบบเป็นชุดด้วย ID ไม่สามารถลบฟิลด์ที่ระบบกำหนดไว้ล่วงหน้าได้ คำขอหนึ่งครั้งลบได้สูงสุด 50 ฟิลด์ โดยส่ง ids เป็นพารามิเตอร์การค้นหาของ URL ที่คั่นด้วยเครื่องหมายจุลภาค ไม่ใช่ในเนื้อหาคำขอ
เมธอดคำขอ
DELETE
Endpoint
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 Key ได้จากหน้าคีย์ API |
พารามิเตอร์คำขอ
| ฟิลด์ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
| 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 | รายละเอียดข้อผิดพลาด |
