Platform APIEnterprise
Translate text
Translate text into a target language and return the detected source language. This endpoint is available only in OpenIM Enterprise.
HTTP request
POST {API_ADDRESS}/third/translate_textRequest example
curl --request POST "${API_ADDRESS}/third/translate_text" \
--header "Content-Type: application/json; charset=utf-8" --header "operationID: ${OPERATION_ID}" --header "token: ${TOKEN}" \
--data-raw '{"content":"Hello","sourceLanguageCode":"en","targetLanguageCode":"zh-CN"}'Request body
| Parameter | Required | Type | Description |
|---|---|---|---|
| content | Yes | string | Text to translate. |
| sourceLanguageCode | Yes | string | Source BCP 47 language tag. Leave empty to enable detection. |
| targetLanguageCode | Yes | string | Target BCP 47 language tag. |
Response
data.translatedText contains the translation and data.detectedLanguageCode contains the detected source BCP 47 tag.
Errors
See Error codes.
Permissions and limits
- Available only in OpenIM Enterprise.
- Input-size and language availability limits depend on the delivered translation service.
Related pages
Was this page helpful?