Mục lục tài liệu

API Tác vụ Dịch thuật

Lấy bản dịch

POST/v1/translation/queryTexts

Nhận văn bản gốc và bản dịch tương ứng được trích xuất bởi hệ thống, trả về dưới định dạng JSON

Địa chỉ đầy đủ
https://otranslator.com/api/v1/translation/queryTexts
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 ý

API này trả về văn bản có cấu trúc trong bộ nhớ cache dịch thuật, phù hợp cho sửa đổi bản dịch, xử lý thứ cấp hoặc đồng bộ vào hệ thống nghiệp vụ.

Nếu nhiệm vụ chưa tạo cache văn bản, texts và revisedTexts sẽ trả về đối tượng rỗng.

Ví dụ

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}'

Tham Số Yêu Cầu

Tham sốLoạiMặc ĐịnhMô TảVí dụ
*taskIdString-

ID nhiệm vụ dịch thuật

-

Phản Hồi

Tham sốLoạiMặc ĐịnhMô TảVí dụ
taskIdString-

ID nhiệm vụ dịch thuật

-
textsJSON-

JSON tương ứng của văn bản gốc và bản dịch

-
revisedTextsJSON-

Văn bản gốc và bản dịch đã được chỉnh sửa

-

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.

API Tác vụ Dịch thuật
Xóa tác vụ dịch thuật
API Tác vụ Dịch thuật
Chỉnh sửa bản dịch