Appearance
PUT
/communication/template-text/template-texts/{id}/translationsRequired scope:
templatetext:updateReplaces the translation map and subjects for a template. Incoming locales win; locales absent from the request are removed. Regenerates all affected notificationtemplate rows.
Request body ​
JSON
{
"translations": {
"sv": {
"t_greeting": "Hej"
}
},
"subjects": {
"sv": "Din order"
}
}
Response ​
The translations were updated successfully.
JSON
{
"translations": {
"sv": {
"t_greeting": "Hej"
}
},
"subjects": {
"sv": "Din order"
},
"sourceLocale": "sv",
"locales": [
"sv",
"en"
]
}
| Error code | Description |
|---|---|
country-block-in-subject | A subject has a country block; country blocks are only allowed in the body. |
invalid-subject | A subject, also one of a country, has a control character (such as a line break) or is longer than 500 characters. |
invalid-translation-size | A translation value is longer than 65536 characters. |
invalid-translations | translations map must be non-empty; a template must have at least one locale. |
language-not-found | One or more requested languages are not in the supported 1:1 language↔country map. |
missing-subject | The template is an email template and an incoming language has no non-blank subject; the message names the languages that have none. |
missing-translation-tokens | One or more {t_*} tokens in the stored canonicalBody have no value in the incoming source-locale translations. |
not-supported-for-usage-type | The template is an invoicetext, which has no subject, and the request has a subject. |
repeat-block-not-supported | The template is an invoicetext, which cannot have repeat blocks ({repeat}...{/repeat}), and a translation has one. |
source-locale-missing | translations must include the template's source locale. |
template-changed | Another request changed the template after it was read, so nothing was saved. Reload the template and try again. |
template-not-found | No template with the given code exists for the current company. |