DumGumDocs
Search documentation

Loading search…

API Reference

Persona Message Translation

POST/cs/v1/smart_translations/persona

Translates the latest persona message into the target language, using the prior conversation as context.

Open interactive API explorer ↗ · Download OpenAPI

Authentication

bearerAuth

Bearer authentication header of the form Bearer <token>, where <token> is an access key.

Example: Authorization: Bearer sk-proj-XXXXXXXXX

Type: bearer

Request body (required)

#application/json

A conversation to translate, with its source and target languages.

Type: object
#source_language stringrequired

Source language. See supported languages guides for full language names.

Type: string

Allowed values: "EN", "EN_GB", "FR", "FR_BE", "RO", "NL", "ES", "DE", "DE_CH", "DE_AT", "IT", "ES_LATAM", "BG", "HE", "JA", "NL_BE", "EN_AU", "PT_PT", "PT_BR", "SV_SE", "DA_DK", "FI_FI", "PL_PL", "LT_LT", "NB_NO", "NN_NO", "SL_SI", "HU", "HU_HU", "CS_CZ", "EL_GR", "EL_GR_LATIN", "EL_GR_GREEK", "HR_HR", "TR_TR", "EN_IE", "AF_ZA", "ZU_ZA", "LV_LV", "SK_SK", "GA_IE", "SR_RS", "ET_EE", "EN_CA", "FR_CA", "RU_RU", "UA_UA"

#target_language stringrequired

Target language. See supported languages guides for full language names.

Type: string

Allowed values: "EN", "EN_GB", "FR", "FR_BE", "RO", "NL", "ES", "DE", "DE_CH", "DE_AT", "IT", "ES_LATAM", "BG", "HE", "JA", "NL_BE", "EN_AU", "PT_PT", "PT_BR", "SV_SE", "DA_DK", "FI_FI", "PL_PL", "LT_LT", "NB_NO", "NN_NO", "SL_SI", "HU", "HU_HU", "CS_CZ", "EL_GR", "EL_GR_LATIN", "EL_GR_GREEK", "HR_HR", "TR_TR", "EN_IE", "AF_ZA", "ZU_ZA", "LV_LV", "SK_SK", "GA_IE", "SR_RS", "ET_EE", "EN_CA", "FR_CA", "RU_RU", "UA_UA"

#messages arrayrequired

The conversation messages, oldest first. The last message must be authored by the side matching the route ('user' for /user, 'persona' for /persona).

Type: array
#Array items

A single message in the conversation.

Type: object
#sender stringrequired

Message author: 'user' or 'persona'.

Type: string
#text stringrequired

Message text in its original language.

Type: string
#tags object

Optional key/value tags attached to the request.

Type: object

#Additional properties

Type: string
#user_gender stringrequired

Gender of the user (subscriber). Used to apply the correct grammatical gender, agreement, and forms of address in the target language.

Type: string

Allowed values: "WOMAN", "MAN"

#persona_gender stringrequired

Gender of the persona (animator). Used to apply the correct grammatical gender, agreement, and forms of address in the target language.

Type: string

Allowed values: "WOMAN", "MAN"

Illustrative example
{
  "source_language": "EN",
  "target_language": "FR",
  "messages": [
    {
      "sender": "user",
      "text": "hello"
    }
  ],
  "tags": {},
  "user_gender": "MAN",
  "persona_gender": "WOMAN"
}

Responses

#200 Response

OK

#*/*

The translated text and the cost charged for the translation.

Type: object
#translation stringrequired

The translated text.

Type: string
#cost stringrequired

Cost charged for this translation, formatted to 6 decimals.

Type: string
Illustrative example
{
  "translation": "bonjour",
  "cost": "0.001050"
}