文档目录

翻译任务 API

获取译文

POST/v1/translation/queryTexts

获取系统提取的一一对应的原文和译文,以 JSON 的格式返回

完整地址
https://otranslator.com/api/v1/translation/queryTexts
认证
需要在 Authorization 请求头中传入 API Key
Content-Type
application/json
错误格式
{ "error": "Invalid API key." }

注意事项

该接口返回翻译缓存中的结构化文本,适合做译文修订、二次处理或同步到业务系统。

如果任务尚未生成文本缓存,texts 和 revisedTexts 会返回空对象。

示例

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

请求参数

参数类型默认描述示例
*taskIdString-

翻译任务ID

-

响应

参数类型默认描述示例
taskIdString-

翻译任务ID

-
textsJSON-

原文和译文对应的JSON

-
revisedTextsJSON-

已修订的原文和译文

-

常见错误

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
删除翻译任务
翻译任务 API
修订译文