Document Directory

Glossary API

Create Glossary

POST/v1/glossary/create

Create a new glossary with terms and translations.

Complete Address
https://deploy-demo.otranslator.com/api/v1/glossary/create
Authentication
API Key needs to be passed in the Authorization request header
Content-Type
application/json
Error Format
{ "error": "Invalid API key." }

Notes

Glossaries are isolated by the account to which the current API Key belongs. When creating a translation task, you can pass in the glossary name through the glossary parameter.

keys is the source terminology list, translated is the JSON mapping from source terminology to target translation.

Example

1curl -X POST 'https://deploy-demo.otranslator.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}'

Request Parameters

ParametersTypeDefaultDescriptionExample
Required: nameString-

Glossary name

Financial terminology
descString-

Glossary Description

-
Required: targetLangString-
  • Indicates that this glossary will be effectively applied when translating documents into the target language
  • Supported languages: Query
English
Required: keysString[]-

List of source terms

["储蓄分流"]
Required: translatedJSON-

JSON Mapping from Source Terms to Translation

{"储蓄分流":"Diversion of household deposits"}

Response

ParametersTypeDefaultDescriptionExample
glossaryIdString-

Glossary ID

-

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.

Glossary API
Query glossary