Skip to main content

Machine Translation API

API Description

The machine translation API translates text between Tibetan and Chinese.

Request Description

URL

https://openapi.sys303.com/api/cognitive/translation

Parameters

Header Parameters
ParameterValue
Content-Typeapplication/json
X-SecretGet it here
Body Parameters
ParameterRequiredTypePossible ValuesDescription
sourceLangYesint-Source language type [0: Tibetan, 1: Chinese]
destLangYesint0Target language type [0: Tibetan, 1: Chinese]
inputTextYesstring0Text to translate [Unicode, max 3000 characters]

Request Example

  curl --request POST \       
--url https://openapi.sys303.com/api/cognitive/translation \
--header 'Content-Type: application/json' \
--header 'X-Secret: {X-Secret}' \
--data '{
"sourceLang": 1,
"destLang": 0,
"inputText": "你好"
}'

Return Explanation

Parameter Description

FieldRequiredTypeStatusDescription
traceIdYesString-Unique traceId for troubleshooting
msgIdYesString-Business status code
msgYesStringError description
dataYesString-Translation result

Return Example

Success
{
"traceId": "0HNL06O44AV58:00000001",
"msgId": "2000000",
"msg": "success",
"data": "ཁྱོད་བདེ་མོ།"
}
Failure

Auth Failed:

{
"traceId": "0HNLN3J9DCJSE:00000001",
"msgId": "4011001",
"msg": "AuthFailed",
"data": null
}

Invalid request parameters:

{
"traceId": "0HNL06O44AUV9:00000001",
"msgId": "500",
"msg": "Specified argument was out of the range of valid values. (Parameter 'source') Actual value was BoAll.",
"data": null
}

Input text too long:

{
"traceId": "0HNL06O44AUVB:00000001",
"msgId": "4004002",
"msg": "InputTooLong",
"data": null
}

Insufficient translation quota:

{
"traceId": "0HNL06O44AUO9:00000001",
"msgId": "2001001",
"msg": "InsufficientInventory",
"data": null
}