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

AspectDescription
Message languageDefined by templateLang (template text is localized per language where supported).
Variable contentSupplied by you in the request (e.g. pin, businessPlatformName); not auto-translated.
Choice of languageSelected 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)).

templateLangLanguage
arArabic
beBelarusian
bgBulgarian
brPortuguese (Brazil)
csCzech
daDanish
deGerman
elGreek
enEnglish
esSpanish
faPersian
fiFinnish
frFrench
heHebrew
hiHindi
hrCroatian
idIndonesian
itItalian
jaJapanese
koKorean
myBurmese
nlDutch
plPolish
ptPortuguese (Portugal)
ruRussian
skSlovak
srSerbian
svSwedish
thThai
trTurkish
ukUkrainian
viVietnamese

Note: Portuguese (Brazil) uses br; Portuguese (Portugal) uses pt.


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)

LanguagetemplateLang
Arabicar
Belarusianbe
Bulgarianbg
Burmesemy
Croatianhr
Czechcs
Danishda
Dutchnl
Englishen
Finnishfi
Frenchfr
Germande
Greekel
Hebrewhe
Hindihi
Indonesianid
Italianit
Japaneseja
Koreanko
Persianfa
Polishpl
Portuguese (Brazil)br
Portuguese (Portugal)pt
Russianru
Serbiansr
Slovaksk
Spanishes
Swedishsv
Thaith
Turkishtr
Ukrainianuk
Vietnamesevi