Glossary API
Terminologielijst bijwerken
Werk woordenlijstdetails of termen bij.
- Volledig adres
- https://otranslator.com/api/v1/glossary/update
- Authenticatie
- De API Key moet doorgegeven worden in de Authorization-verzoekheader
- Content-Type
- application/json
- Onjuist formaat
- { "error": "Invalid API key." }
Aandachtspunten
Niet doorgegeven velden blijven ongewijzigd.
Bij het bijwerken van keys wordt aanbevolen om translated ook bij te werken, zodat elke bronterm een corresponderende vertaling heeft.
Voorbeeld
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}'Verzoekparameters
| Parameters | Type | Standaard | Beschrijving | Voorbeeld |
|---|---|---|---|---|
| *glossaryId | String | - | Terminologielijst-ID | - |
| name | String | - | Naam | Financiële terminologie2 |
| desc | String | - | Beschrijving | - |
| targetLang | String | - |
| - |
| keys | String[] | - | Array van alle terminologie | ["储蓄分流"] |
| translated | JSON | - | Map van terminologie naar corresponderende vertalingen | {"储蓄分流":"Diversion of household deposits"} |
Reactie
| Parameters | Type | Standaard | Beschrijving | Voorbeeld |
|---|---|---|---|---|
| glossaryId | String | - | Terminologielijst-ID | - |
| name | String | - | Naam | - |
| desc | String | - | Beschrijving | - |
| targetLang | String | - | Doeltaal | - |
| keys | String[] | - | Array van alle terminologie | - |
| translated | JSON | - | Map van terminologie naar corresponderende vertalingen | - |
| createdAt | DateTime | - | Aanmaaktijd van de terminologielijst | - |
| updatedAt | DateTime | - | Bijwerktijd van de terminologielijst | - |
Veelvoorkomende fouten
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.