API de glossaire
Mettre à jour le glossaire terminologique
Modifier les détails du glossaire ou les termes.
- Adresse complète
- https://otranslator.com/api/v1/glossary/update
- Authentification
- Il est nécessaire de transmettre la clé API dans l'en-tête de requête Authorization
- Content-Type
- application/json
- Format erroné
- { "error": "Invalid API key." }
Points à noter
Les champs non transmis conserveront leur valeur d'origine.
Si vous mettez à jour keys, il est recommandé de synchroniser translated, pour garantir que chaque terme source ait une traduction correspondante.
Exemple
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}'Paramètres de requête
| Paramètres | Type | Par défaut | Description | Exemple |
|---|---|---|---|---|
| *glossaryId | String | - | Identifiant du glossaire | - |
| name | String | - | Nom | Terminologie financière 2 |
| desc | String | - | Description | - |
| targetLang | String | - |
| - |
| keys | String[] | - | Tableau de tous les termes | ["储蓄分流"] |
| translated | JSON | - | Correspondances de traduction des termes (Map) | {"储蓄分流":"Diversion of household deposits"} |
Réponse
| Paramètres | Type | Par défaut | Description | Exemple |
|---|---|---|---|---|
| glossaryId | String | - | Identifiant du glossaire | - |
| name | String | - | Nom | - |
| desc | String | - | Description | - |
| targetLang | String | - | Langue cible | - |
| keys | String[] | - | Tableau de tous les termes | - |
| translated | JSON | - | Correspondances de traduction des termes (Map) | - |
| createdAt | DateTime | - | Date de création du glossaire | - |
| updatedAt | DateTime | - | Heure de mise à jour du glossaire | - |
Erreurs courantes
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.