API งานการแปล
สอบถามงานแปล
สอบถามสถานะและรายละเอียดของงานแปล
- ที่อยู่แบบเต็ม
- https://otranslator.com/api/v1/translation/query
- การรับรอง
- ต้องส่งผ่าน API Key ในส่วนหัวคำขอ Authorization
- Content-Type
- application/json
- รูปแบบการตอบกลับข้อผิดพลาด
- { "error": "Invalid API key." }
ข้อควรระวัง
แนะนำให้ตรวจสอบ interface นี้เป็นระยะเมื่อสถานะงานเป็น Waiting หรือ Processing และหยุดการตรวจสอบเมื่อสถานะเข้าสู่ Completed, Terminated หรือ Cancelled
ลิงก์ดาวน์โหลดเป็นที่อยู่เข้าถึงชั่วคราว กรุณาบันทึกไฟล์หรือสอบถามใหม่อีกครั้งตามความจำเป็นทางฝ่ายธุรกิจของคุณ
ตัวอย่าง
1curl -X POST 'https://otranslator.com/api/v1/translation/query' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "taskId": "[string]"
6}'พารามิเตอร์ของคำขอ
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| จำเป็น: taskId | String | - | รหัสงานแปล | - |
การตอบสนอง
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| taskId | String | - | รหัสงาน | - |
| model | String | - | โมเดลที่ใช้ในการแปลเอกสาร | - |
| fromLang | String | - | ภาษาต้นฉบับ | - |
| toLang | String | - | ภาษาเป้าหมาย | - |
| status | String | - | สถานะ: 'Init' | 'Waiting' | 'Processing' | 'Completed' | 'Terminated' | 'Cancelled' | - |
| progress | Number | - | ความคืบหน้า, 0~100 | - |
| errorMsg | String | - | ข้อมูลข้อผิดพลาด | - |
| fileTitle | String | - | ชื่อไฟล์ต้นฉบับ | - |
| fileUrl | String | - | ที่อยู่ดาวน์โหลดไฟล์ต้นฉบับ | - |
| translatedFileUrl | String | - | ลิงก์ดาวน์โหลดข้อความแปล | - |
| translatedBilingualFileUrl | String | - |
| - |
| translatedEditableFileUrl | String | - | ที่อยู่ดาวน์โหลดไฟล์แปลที่แก้ไขได้ จะแสดงผลเฉพาะเมื่อมีการสร้างผลลัพธ์ที่แก้ไขได้สำหรับประเภทไฟล์ที่เกี่ยวข้อง | - |
| tokenCount | Integer | - |
| - |
| wordNums | Integer | - | สถิติจำนวนคำของเอกสาร ค่านี้อาจว่างเปล่าขึ้นอยู่กับประเภทไฟล์ | - |
| price | Integer | - | จำนวน Credits ที่จำเป็นสำหรับการแปลทั้งหมด | - |
| usedCredits | Integer | - | จำนวน Credits ที่ใช้ไปแล้วในงานแปล | - |
| glossary | String[] | - | ชื่ออภิธานศัพท์ที่ใช้ในงานแปล | - |
| shouldTranslateImage | Boolean | - | จะแปลรูปภาพในเอกสารหรือไม่ | - |
| forceOCR | Boolean | - | บังคับให้ใช้ OCR ในการจดจำเนื้อหาเอกสารหรือไม่ | - |
| 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: 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.