API งานการแปล
แก้ไขคำแปล
ส่งการแก้ไขสำหรับข้อความที่แปลแล้วในงาน พร้อมตัวเลือกในการสร้างการแปลใหม่
- ที่อยู่แบบเต็ม
- https://otranslator.com/api/v1/translation/updateTexts
- การรับรอง
- ต้องส่งผ่าน API Key ในส่วนหัวคำขอ Authorization
- Content-Type
- application/json
- รูปแบบผิดพลาด
- { "error": "Invalid API key." }
ข้อควรระวัง
revisedTexts จะถูกเขียนลงในแคชการแปลของงาน ใช้สำหรับบันทึกคำแปลที่ได้รับการปรับแก้โดยมนุษย์
เมื่อ startTranslation เป็น true จะทริกเกอร์การประมวลผลงานใหม่หลังจากบันทึกการแก้ไข
ตัวอย่าง
1curl -X POST 'https://otranslator.com/api/v1/translation/updateTexts' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "taskId": "[string]",
6 "revisedTexts": {
7 "key": "value"
8 }
9}'พารามิเตอร์ของคำขอ
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| *taskId | String | - | รหัสงานแปล | - |
| *revisedTexts | JSON | - | คำแปลที่แก้ไขแล้ว | - |
| startTranslation | Boolean | false | สร้างข้อความแปลใหม่หรือไม่ | - |
การตอบสนอง
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| success | Boolean | - | การอัปเดตสำเร็จหรือไม่ | - |
ข้อผิดพลาดทั่วไป
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.
409 Task is processing. Try again after it finishes.
revisedTexts cannot be updated while the task is processing.