用語集API
用語集を更新します。
POST/v1/glossary/update
用語集の詳細または用語を更新します。
- 完全な住所
- https://otranslator.com/api/v1/glossary/update
- 認証
- Authorizationリクエストヘッダーに API Key を渡す必要があります
- Content-Type
- application/json
- 誤った形式
- { "error": "Invalid API key." }
注意事項
渡されていないフィールドは元の値を保持します。
keysを更新する場合は、translatedも同期して更新し、各ソース用語に対応する訳文があることを確認することを推奨します。
例
curl
1curl -X POST 'https://otranslator.com/api/v1/glossary/update' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "glossaryId": "[string]",
6 "name": "0twXbd",
7 "keys": [
8 "储蓄分流"
9 ],
10 "translated": {
11 "储蓄分流": "Diversion of household deposits"
12 }
13}'リクエストパラメータ
| パラメータ | タイプ | デフォルト | 説明 | 例 |
|---|---|---|---|---|
| *glossaryId | String | - | 用語集ID | - |
| name | String | - | 名称 | 金融用語2 |
| desc | String | - | 説明 | - |
| targetLang | String | - |
| - |
| keys | String[] | - | すべての専門用語の配列 | ["储蓄分流"] |
| translated | JSON | - | 用語対応訳文のMap | {"储蓄分流":"Diversion of household deposits"} |
レスポンス
| パラメータ | タイプ | デフォルト | 説明 | 例 |
|---|---|---|---|---|
| glossaryId | String | - | 用語集ID | - |
| name | String | - | 名称 | - |
| desc | String | - | 説明 | - |
| targetLang | String | - | 対象言語 | - |
| keys | String[] | - | すべての専門用語の配列 | - |
| translated | JSON | - | 用語対応訳文のMap | - |
| createdAt | DateTime | - | 用語集の作成時間 | - |
| updatedAt | DateTime | - | 用語集の更新時間 | - |
よくあるエラー
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: glossaryId.
Provide the glossaryId returned by the create glossary API.
404 Glossary not found.
The glossary does not exist or does not belong to the current API account.