术语表 API
查询术语表
POST/v1/glossary/query
通过ID获取术语表详情。
- 完整地址
- https://otranslator.com/api/v1/glossary/query
- 认证
- 需要在 Authorization 请求头中传入 API Key
- 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.