文檔目錄

術語表 API

更新術語表

POST/v1/glossary/update

更新術語表詳情或術語。

完整地址
https://otranslator.com/api/v1/glossary/update
認證
需要在 Authorization 請求頭中傳入 API Key
Content-Type
application/json
錯誤格式
{ "error": "Invalid API key." }

注意事項

未傳入的欄位會保持原值不變。

如更新 keys,建議同步更新 translated,確保每個源術語都有對應譯文。

範例

curl
1curl -X POST 'https://otranslator.com/api/v1/glossary/update' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5  "glossaryId": "[string]",
6  "name": "0twXbd",
7  "keys": [
8    "储蓄分流"
9  ],
10  "translated": {
11    "储蓄分流": "Diversion of household deposits"
12  }
13}'

請求參數

參數類型預設描述範例
*glossaryIdString-

術語表ID

-
nameString-

名稱

金融術語2
descString-

描述

-
targetLangString-
  • 目標語言
  • 支援語言:查詢
-
keysString[]-

所有術語的陣列

["储蓄分流"]
translatedJSON-

術語對應譯文的Map

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

響應

參數類型預設描述範例
glossaryIdString-

術語表ID

-
nameString-

名稱

-
descString-

描述

-
targetLangString-

目標語言

-
keysString[]-

所有術語的陣列

-
translatedJSON-

術語對應譯文的Map

-
createdAtDateTime-

術語表的建立時間

-
updatedAtDateTime-

術語表的更新時間

-

常見錯誤

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.

術語表 API
查詢術語表
術語表 API
刪除術語表