API งานการแปล
รับข้อความแปล
POST/v1/translation/queryTexts
รับต้นฉบับและคำแปลที่ตรงกันซึ่งดึงมาจากระบบในรูปแบบ JSON
- ที่อยู่แบบเต็ม
- https://otranslator.com/api/v1/translation/queryTexts
- การรับรอง
- ต้องส่งผ่าน API Key ในส่วนหัวคำขอ Authorization
- Content-Type
- application/json
- รูปแบบผิดพลาด
- { "error": "Invalid API key." }
ข้อควรระวัง
อินเทอร์เฟซนี้ส่งกลับข้อความที่มีโครงสร้างจากแคชการแปล เหมาะสำหรับการแก้ไขคำแปล การประมวลผลรอบสอง หรือการซิงโครไนซ์ไปยังระบบธุรกิจ
หากงานยังไม่ได้สร้าง text cache texts และ revisedTexts จะคืนค่า object ว่าง
ตัวอย่าง
curl
1curl -X POST 'https://otranslator.com/api/v1/translation/queryTexts' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "taskId": "[string]"
6}'พารามิเตอร์ของคำขอ
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| *taskId | String | - | รหัสงานแปล | - |
การตอบสนอง
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| taskId | String | - | รหัสงานแปล | - |
| texts | JSON | - | JSON ที่สอดคล้องกับต้นฉบับและคำแปล | - |
| revisedTexts | JSON | - | ต้นฉบับและ | - |
ข้อผิดพลาดทั่วไป
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: taskId.
Provide the taskId returned by the create translation task API.
404 Task not found.
The task does not exist, has been deleted, does not belong to the current API account, or was not created through the API.