Localization
The templateLang parameter sets the language of the OTP message. Variable content (e.g. PIN, platform name) is provided by the sender; the sender also chooses the message language via templateLang.
How it works
| Aspect | Description |
|---|---|
| Message language | Defined by templateLang (template text is localized per language where supported). |
| Variable content | Supplied by you in the request (e.g. pin, businessPlatformName); not auto-translated. |
| Choice of language | Selected by the sender when sending the OTP request. |
Use templateLang in your request body when calling the Viber OTP API. If omitted, the provider’s default (typically English) usually applies.
Supported languages
Supported values for templateLang are ISO 639-1 two-letter language codes (with one provider-specific exception for Portuguese (Brazil)).
| templateLang | Language |
|---|---|
ar | Arabic |
be | Belarusian |
bg | Bulgarian |
br | Portuguese (Brazil) |
cs | Czech |
da | Danish |
de | German |
el | Greek |
en | English |
es | Spanish |
fa | Persian |
fi | Finnish |
fr | French |
he | Hebrew |
hi | Hindi |
hr | Croatian |
id | Indonesian |
it | Italian |
ja | Japanese |
ko | Korean |
my | Burmese |
nl | Dutch |
pl | Polish |
pt | Portuguese (Portugal) |
ru | Russian |
sk | Slovak |
sr | Serbian |
sv | Swedish |
th | Thai |
tr | Turkish |
uk | Ukrainian |
vi | Vietnamese |
Note: Portuguese (Brazil) uses
br; Portuguese (Portugal) usespt.
Example request
{
"to": "+306912345678",
"templateId": "0aac888f-2ee2-4112-9659-1755a951966a",
"templateParams": {
"pin": "847291"
},
"templateLang": "el"
}
This sends a basic OTP with the template text in Greek; the pin value is your own data and is not translated.
Quick reference (by language name)
| Language | templateLang |
|---|---|
| Arabic | ar |
| Belarusian | be |
| Bulgarian | bg |
| Burmese | my |
| Croatian | hr |
| Czech | cs |
| Danish | da |
| Dutch | nl |
| English | en |
| Finnish | fi |
| French | fr |
| German | de |
| Greek | el |
| Hebrew | he |
| Hindi | hi |
| Indonesian | id |
| Italian | it |
| Japanese | ja |
| Korean | ko |
| Persian | fa |
| Polish | pl |
| Portuguese (Brazil) | br |
| Portuguese (Portugal) | pt |
| Russian | ru |
| Serbian | sr |
| Slovak | sk |
| Spanish | es |
| Swedish | sv |
| Thai | th |
| Turkish | tr |
| Ukrainian | uk |
| Vietnamese | vi |
Updated about 1 month ago
