術語表 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.