API Glosariusza
Aktualizacja słownika terminologicznego
Aktualizuj szczegóły glosariusza lub terminy.
- Pełny adres
- https://dltranslator.com/api/v1/glossary/update
- Uwierzytelnienie
- Należy przekazać API Key w nagłówku żądania Authorization
- Content-Type
- application/json
- Nieprawidłowy format
- { "error": "Invalid API key." }
Uwagi
Pola, które nie zostały przekazane, zachowają oryginalną wartość.
Jeśli aktualizujesz keys, zaleca się jednoczesną aktualizację translated, aby zapewnić, że każdy termin źródłowy ma odpowiadające mu tłumaczenie.
Przykład
1curl -X POST 'https://dltranslator.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}'Parametry żądania
| Parametry | Typ | Domyślny | Opis | Przykład |
|---|---|---|---|---|
| *glossaryId | String | - | ID glosariusza | - |
| name | String | - | Nazwa | Terminologia finansowa 2 |
| desc | String | - | Opis | - |
| targetLang | String | - |
| - |
| keys | String[] | - | Tablica wszystkich terminów | ["储蓄分流"] |
| translated | JSON | - | Mapa tłumaczeń terminów | {"储蓄分流":"Diversion of household deposits"} |
Odpowiedź
| Parametry | Typ | Domyślny | Opis | Przykład |
|---|---|---|---|---|
| glossaryId | String | - | ID glosariusza | - |
| name | String | - | Nazwa | - |
| desc | String | - | Opis | - |
| targetLang | String | - | Język docelowy | - |
| keys | String[] | - | Tablica wszystkich terminów | - |
| translated | JSON | - | Mapa tłumaczeń terminów | - |
| createdAt | DateTime | - | Data utworzenia glosariusza | - |
| updatedAt | DateTime | - | Czas aktualizacji słownika terminologicznego | - |
Typowe błędy
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.