API อภิธานศัพท์
สอบถามอภิธานศัพท์
POST/v1/glossary/query
รับรายละเอียดของอภิธานศัพท์ตาม ID
- ที่อยู่แบบเต็ม
- https://otranslator.com/api/v1/glossary/query
- การรับรอง
- ต้องส่งผ่าน API Key ในส่วนหัวคำขอ Authorization
- Content-Type
- application/json
- รูปแบบการตอบกลับข้อผิดพลาด
- { "error": "Invalid API key." }
ตัวอย่าง
1curl -X POST 'https://otranslator.com/api/v1/glossary/query' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "glossaryId": "[string]"
6}'พารามิเตอร์ของคำขอ
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| จำเป็น: glossaryId | String | - | ID อภิธานศัพท์ | - |
การตอบสนอง
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| glossaryId | String | - | ID อภิธานศัพท์ | - |
| name | String | - | ชื่ออภิธานศัพท์ | - |
| desc | String | - | คำอธิบายอภิธานศัพท์ | - |
| targetLang | String | - | ภาษาเป้าหมาย | - |
| keys | String[] | - | รายการศัพท์ต้นทาง | - |
| translated | JSON | - | การแมป JSON ของคำศัพท์จากต้นฉบับสู่คำแปล | - |
| 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.