API อภิธานศัพท์
อัปเดตอภิธานศัพท์
อัปเดตรายละเอียดศัพทานุกรมหรือคำศัพท์
- ที่อยู่แบบเต็ม
- https://dltranslator.com/api/v1/glossary/update
- การรับรอง
- ต้องส่งผ่าน API Key ในส่วนหัวคำขอ Authorization
- Content-Type
- application/json
- รูปแบบผิดพลาด
- { "error": "Invalid API key." }
ข้อควรระวัง
ฟิลด์ที่ไม่ได้ส่งจะคงค่าเดิมไว้ไม่เปลี่ยนแปลง
หากมีการอัปเดต keys แนะนำให้อัปเดต translated พร้อมกันด้วย เพื่อให้แน่ใจว่าทุกคำศัพท์ต้นฉบับมีคำแปลที่สอดคล้อง
ตัวอย่าง
1curl -X POST 'https://dltranslator.com/api/v1/glossary/update' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "glossaryId": "[string]",
6 "name": "0twXbd",
7 "keys": [
8 "储蓄分流"
9 ],
10 "translated": {
11 "储蓄分流": "Diversion of household deposits"
12 }
13}'พารามิเตอร์ของคำขอ
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| *glossaryId | String | - | ID ของรายการศัพท์เทคนิค | - |
| name | String | - | ชื่อ | ศัพท์ทางการเงิน2 |
| desc | String | - | คำอธิบาย | - |
| targetLang | String | - |
| - |
| keys | String[] | - | อาร์เรย์ของศัพท์เทคนิคทั้งหมด | ["储蓄分流"] |
| translated | JSON | - | Map ของศัพท์เทคนิคที่สอดคล้องกับคำแปล | {"储蓄分流":"Diversion of household deposits"} |
การตอบสนอง
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| glossaryId | String | - | ID ของรายการศัพท์เทคนิค | - |
| name | String | - | ชื่อ | - |
| desc | String | - | คำอธิบาย | - |
| targetLang | String | - | ภาษาเป้าหมาย | - |
| keys | String[] | - | อาร์เรย์ของศัพท์เทคนิคทั้งหมด | - |
| translated | JSON | - | Map ของศัพท์เทคนิคที่สอดคล้องกับคำแปล | - |
| createdAt | DateTime | - | เวลาที่สร้างรายการศัพท์เทคนิค | - |
| updatedAt | DateTime | - | เวลาอัปเดตของศัพท์บัญญัติ | - |
ข้อผิดพลาดทั่วไป
401 Missing API key.
The Authorization request header is required.
401 Invalid API key.
The API key does not exist, has been deleted, or is no longer valid.
400 Missing required parameter: glossaryId.
Provide the glossaryId returned by the create glossary API.
404 Glossary not found.
The glossary does not exist or does not belong to the current API account.