API Glosariusza
Utwórz słownik terminologiczny
POST/v1/glossary/create
Utwórz nowy glosariusz z terminami i tłumaczeniami.
- Pełny adres
- https://dltranslator.com/api/v1/glossary/create
- Uwierzytelnienie
- Należy przekazać API Key w nagłówku żądania Authorization
- Content-Type
- application/json
- Nieprawidłowy format
- { "error": "Invalid API key." }
Uwagi
Glosariusze są izolowane według konta, do którego należy aktualny klucz API. Przy tworzeniu zadania tłumaczenia można przekazać nazwę glosariusza za pomocą parametru glossary.
keys to lista terminów źródłowych, translated to mapowanie JSON z terminów źródłowych na tłumaczenia docelowe.
Przykład
curl
1curl -X POST 'https://dltranslator.com/api/v1/glossary/create' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "name": "N9aErn",
6 "targetLang": "English",
7 "keys": [
8 "储蓄分流"
9 ],
10 "translated": {
11 "储蓄分流": "Diversion of household deposits"
12 }
13}'Parametry żądania
| Parametry | Typ | Domyślny | Opis | Przykład |
|---|---|---|---|---|
| *name | String | - | Nazwa glosariusza | Terminologia finansowa |
| desc | String | - | Opis słownika terminologicznego | - |
| *targetLang | String | - |
| English |
| *keys | String[] | - | Lista terminów źródłowych | ["储蓄分流"] |
| *translated | JSON | - | Mapowanie JSON terminologii źródłowej na tłumaczenie | {"储蓄分流":"Diversion of household deposits"} |
Odpowiedź
| Parametry | Typ | Domyślny | Opis | Przykład |
|---|---|---|---|---|
| glossaryId | String | - | ID glosariusza | - |
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.