API Tác vụ Dịch thuật
Chỉnh sửa bản dịch
Gửi bản sửa đổi cho các văn bản đã dịch trong một tác vụ, với tùy chọn tạo lại bản dịch.
- Địa chỉ đầy đủ
- https://otranslator.com/api/v1/translation/updateTexts
- Xác thực
- Cần truyền API Key vào request header Authorization
- Content-Type
- application/json
- Lỗi định dạng
- { "error": "Invalid API key." }
Lưu ý
revisedTexts sẽ được ghi vào bộ nhớ đệm dịch thuật nhiệm vụ, dùng để lưu bản dịch đã được hiệu đính thủ công.
Khi startTranslation là true, sẽ kích hoạt lại việc xử lý tác vụ sau khi lưu bản chỉnh sửa.
Ví dụ
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}'Tham Số Yêu Cầu
| Tham số | Loại | Mặc Định | Mô Tả | Ví dụ |
|---|---|---|---|---|
| *taskId | String | - | ID nhiệm vụ dịch thuật | - |
| *revisedTexts | JSON | - | Bản dịch đã được chỉnh sửa | - |
| startTranslation | Boolean | false | Có tạo lại bản dịch không | - |
Phản Hồi
| Tham số | Loại | Mặc Định | Mô Tả | Ví dụ |
|---|---|---|---|---|
| success | Boolean | - | Có cập nhật thành công không | - |
Lỗi thường gặp
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.