API งานการแปล
เริ่มงานแปลใหม่อีกครั้ง
ใช้สำหรับการเริ่มต้นใหม่ของงานที่ Terminated หรือชำระคะแนนเพื่อแปลเอกสารเต็ม
- ที่อยู่แบบเต็ม
- https://otranslator.com/api/v1/translation/start
- การรับรอง
- ต้องส่งผ่าน API Key ในส่วนหัวคำขอ Authorization
- Content-Type
- application/json
- รูปแบบผิดพลาด
- { "error": "Invalid API key." }
ข้อควรระวัง
อินเทอร์เฟซนี้สามารถใช้เพื่อรีสตาร์ตงานที่มีสถานะ Terminated และยังสามารถชำระเงินผ่าน payWithCredits หลังจากงานแสดงตัวอย่างเสร็จสิ้นเพื่อเริ่มการแปลเอกสารฉบับเต็ม
งานที่ชำระเงินแล้วจะไม่มีการหักค่าใช้จ่ายซ้ำเมื่อส่ง model เข้ามา จะใช้สำหรับคำนวณค่าใช้จ่ายใหม่เฉพาะในกรณีที่ payWithCredits เป็น true และงานยังไม่ได้ชำระเงิน
ตัวอย่าง
1curl -X POST 'https://otranslator.com/api/v1/translation/start' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "taskId": "[string]"
6}'พารามิเตอร์ของคำขอ
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| *taskId | String | - | รหัสงานแปล | - |
| payWithCredits | Boolean | - | ชำระเงินสำหรับงานแปลหรือไม่ มีผลเฉพาะเมื่อเอกสารยังไม่ได้ชำระเงิน เอกสารที่ชำระเงินแล้วจะไม่ถูกหักค่าใช้จ่ายซ้ำ | - |
| model | String | - |
| - |
การตอบสนอง
| พารามิเตอร์ | ประเภท | ค่าเริ่มต้น | คำอธิบาย | ตัวอย่าง |
|---|---|---|---|---|
| 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.
402 Insufficient credits balance.
The account does not have enough credits to start the full translation.
404 Task not found.
The task does not exist or does not belong to the current API account.