API глосарію
Запит глосарію
POST/v1/glossary/query
Отримати деталі глосарію за ID.
- Повна адреса
- https://otranslator.com/api/v1/glossary/query
- Аутентифікація
- Потрібно передати API Key у заголовку запиту Authorization
- Content-Type
- application/json
- Неправильний формат
- { "error": "Invalid API key." }
Приклад
curl
1curl -X POST 'https://otranslator.com/api/v1/glossary/query' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "glossaryId": "[string]"
6}'Параметри запиту
| Параметри | Тип | За замовчуванням | Опис | Приклад |
|---|---|---|---|---|
| *glossaryId | String | - | ID глосарія | - |
Відповідь
| Параметри | Тип | За замовчуванням | Опис | Приклад |
|---|---|---|---|---|
| glossaryId | String | - | ID глосарія | - |
| name | String | - | Назва глосарію | - |
| desc | String | - | Опис глосарія | - |
| targetLang | String | - | Цільова мова | - |
| keys | String[] | - | Список вихідних термінів | - |
| translated | JSON | - | JSON-відображення від вихідних термінів до перекладу | - |
| createdAt | DateTime | - | Час створення глосарія | - |
| updatedAt | DateTime | - | Час оновлення глосарію | - |
Поширені помилки
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.