Translation Task API
Restart translation task
Used for restarting terminated tasks, or paying credits for full document translation
- Complete address
- https://otranslator.com/api/v1/translation/start
- 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 can be used to restart Terminated tasks, or to pay with credits via payWithCredits and start full text translation after the preview task is completed.
Paid tasks will not be charged twice. When passing the model parameter, it is only used to recalculate fees when payWithCredits is true and the task has not been paid.
Example
1curl -X POST 'https://otranslator.com/api/v1/translation/start' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "taskId": "[string]"
6}'Request Parameters
| Parameters | Type | Default | Description | Example |
|---|---|---|---|---|
| *taskId | String | - | Translation Task ID | - |
| payWithCredits | Boolean | - | Process payment for translation task (only applicable to unpaid documents; paid documents will not incur duplicate charges) | - |
| model | String | - |
| - |
Response
| Parameters | Type | Default | Description | Example |
|---|---|---|---|---|
| success | Boolean | - | Startup successful | - |
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.
402 Insufficient credits balance.
The account does not have enough credits to start the full translation.
404 Task not found.
The task does not exist or does not belong to the current API account.