翻訳タスクAPI
翻訳タスクを再開
POST/v1/translation/start
終了済みタスクの再開、またはポイント支払いによる全文翻訳に使用
- 完全な住所
- https://otranslator.com/api/v1/translation/start
- 認証
- Authorizationリクエストヘッダーに API Key を渡す必要があります
- Content-Type
- application/json
- 誤った形式
- { "error": "Invalid API key." }
注意事項
このインターフェースは、Terminatedタスクの再起動に使用できるほか、プレビュータスク完了後にpayWithCreditsで支払って全文翻訳を開始することもできます。
支払い済みのタスクは重複で課金されることはありません。modelを渡す際、payWithCreditsがtrueかつタスクが未払いの場合のみ、費用を再計算するために使用されます。
例
curl
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}'リクエストパラメータ
| パラメータ | タイプ | デフォルト | 説明 | 例 |
|---|---|---|---|---|
| *taskId | String | - | 翻訳タスクID | - |
| payWithCredits | Boolean | - | 翻訳タスクの支払いを行うかどうか。文書が未払いの場合のみ有効で、既に支払い済みの文書については重複して課金されません | - |
| model | String | - |
| - |
レスポンス
| パラメータ | タイプ | デフォルト | 説明 | 例 |
|---|---|---|---|---|
| success | Boolean | - | 起動が成功したかどうか | - |
よくあるエラー
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.