Translation Task API
Retrieve translation
Retrieve the one-to-one corresponding source text and translation extracted by the system, returned in JSON format
- Complete Address
- https://deploy-demo.otranslator.com/api/v1/translation/queryTexts
- Authentication
- API Key needs to be passed in the Authorization request header
- Content-Type
- application/json
- Error Format
- { "error": "Invalid API key." }
Notes
This endpoint 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
1curl -X POST 'https://deploy-demo.otranslator.com/api/v1/translation/queryTexts' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "taskId": "[string]"
6}'Request Parameters
| Parameters | Type | Default | Description | Example |
|---|---|---|---|---|
| Required: taskId | String | - | Translation Task ID | - |
Response
| Parameters | Type | Default | Description | Example |
|---|---|---|---|---|
| taskId | String | - | Translation Task ID | - |
| texts | JSON | - | JSON corresponding to source text and translation | - |
| revisedTexts | JSON | - | 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.