文档目录

术语表 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
删除术语表