翻訳タスク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}'リクエストパラメータ
| パラメータ | タイプ | デフォルト | 説明 | 例 |
|---|---|---|---|---|
| *taskId | String | - | 翻訳タスクID | - |
レスポンス
| パラメータ | タイプ | デフォルト | 説明 | 例 |
|---|---|---|---|---|
| taskId | String | - | 翻訳タスクID | - |
| texts | JSON | - | 原文と翻訳文に対応するJSON | - |
| revisedTexts | JSON | - | 修正済みの原文と翻訳文 | - |
よくあるエラー
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.