Document Directory

Glossary API

Create glossary

POST/v1/glossary/create

Create a new glossary with terms and translations.

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

Precautions

Glossaries are isolated by the account associated with the current API Key. When creating a translation task, the glossary name can be passed in through the glossary parameter.

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

Example

curl
1curl -X POST 'https://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
*nameString-

Glossary name

Financial terminology
descString-

Glossary description

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

List of source terms

["储蓄分流"]
*translatedJSON-

JSON mapping from source terms to translations

{"储蓄分流":"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.

Information API
Query supported models
Glossary API
Query glossary