Document Directory

Translation Task API

Retrieve translation

POST/v1/translation/queryTexts

Get system-extracted one-to-one correspondence of original text and translation, returned in JSON format

Complete address
https://otranslator.com/api/v1/translation/queryTexts
Authentication
API Key needs to be passed in the Authorization request header
Content-Type
application/json
Invalid format
{ "error": "Invalid API key." }

Precautions

This API returns structured text from the translation cache, suitable for translation revision, secondary processing, or synchronization to business systems.

If the task has not yet generated a text cache, texts and revisedTexts will return empty objects.

Example

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

Request Parameters

ParametersTypeDefaultDescriptionExample
*taskIdString-

Translation Task ID

-

Response

ParametersTypeDefaultDescriptionExample
taskIdString-

Translation Task ID

-
textsJSON-

JSON mapping of source text and translated text

-
revisedTextsJSON-

Revised original text and translation

-

Common Errors

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.

Translation Task API
Delete Translation Task
Translation Task API
Revise Translation