服务端对接
鉴权
具体验签过程参考 服务端回调验签机制。 sign 字段的签算过程见 s2s md5 加密 小节。
POST 翻译接口
POST /api/open/translate/text
Body 请求参数
{
"text": "string",
"targetLanguage": "string",
"appId": 0,
"nonce": "string",
"timestamp": 0,
"sign": "string"
}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
body | body | Request | 否 | none |
返回示例
200 Response
"string"
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | none | Response |
数据模型
Request
{
"text": "string",
"targetLanguage": "string",
"appId": 0,
"nonce": "string",
"timestamp": 0,
"sign": "string"
}
属性
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
text | string | true | none | none | |
targetLanguage | string | true | none | ISO_639 https://cloud.google.com/translate/docs/languages | |
appId | integer | true | none | none | |
nonce | string | true | none | none | |
timestamp | integer(int64) | true | none | none | |
sign | string | true | none | none |
Response
{
"translate": "string"
}
属性
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
translate | string | false | none | none |