Glossary API
Update glossary
Update glossary details or terms.
- Complete Address
- https://deploy-demo.otranslator.com/api/v1/glossary/update
- Authentication
- API Key needs to be passed in the Authorization request header
- Content-Type
- application/json
- Error Format
- { "error": "Invalid API key." }
Notes
Fields that are not passed in will remain at their original values.
If updating keys, it is recommended to synchronize the update of translated to ensure each source term has a corresponding translation.
Example
1curl -X POST 'https://deploy-demo.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}'Request Parameters
| Parameters | Type | Default | Description | Example |
|---|---|---|---|---|
| Required: glossaryId | String | - | Glossary ID | - |
| name | String | - | Name | Financial terminology 2 |
| desc | String | - | Description | - |
| targetLang | String | - |
| - |
| keys | String[] | - | Array of all terms | ["储蓄分流"] |
| translated | JSON | - | Terminology translation mapping | {"储蓄分流":"Diversion of household deposits"} |
Response
| Parameters | Type | Default | Description | Example |
|---|---|---|---|---|
| glossaryId | String | - | Glossary ID | - |
| name | String | - | Name | - |
| desc | String | - | Description | - |
| targetLang | String | - | Target Language | - |
| keys | String[] | - | Array of all terms | - |
| translated | JSON | - | Terminology translation mapping | - |
| createdAt | DateTime | - | Glossary creation time | - |
| updatedAt | DateTime | - | Glossary update time | - |
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: 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.