Template messages
The Viber Business Messages channel allows you to send predefined template messages. These templates are pre-constructed, and you refer to them by their template ID when sending the message. Currently, only one time passwords (OTP) templates are supported.
OTP templates
Viber Business Messages supports predefined one time passwords (OTP) templates. Note the following:
-
When sending an OTP template, you'll populate the
channel_template
property of thetemplate_message
object . -
When sending an OTP template, you must populate the
template_id
property . You may also populate thelanguage_code
property . Finally, you must provide the values for theparameters
property . - OTP messages can be sent to all of a user's devices or just their primary device. See Viber Business Messages channel properties for more details.
Below is an example of sending a Basic OTP template message:
{
"message": {
"template_message": {
"channel_template": {
"VIBERBM": {
"template_id": "0aac888f-2ee2-4112-9659-1755a951966a",
"language_code": "en",
"parameters": {
"pin": "1234"
}
}
}
}
},
"channel_properties": {
"VIBERBM_TEMPLATE_MESSAGE_DEVICES": "ALL"
}
}
The rendered message:
Each template is localized to multiple languages. The following languages are supported:
Language | Code |
---|---|
English | en |
Arabic | ar |
Bulgarian | bg |
Croatian | hr |
Czech | cs |
Danish | da |
German | de |
Greek | el |
Spanish | es |
Finnish | fi |
French | fr |
Hebrew | he |
Burmese | my |
Hungarian | hu |
Indonesian | id |
Italian | it |
Norwegian | no |
Dutch | nl |
Polish | pl |
Portuguese (Portugal) | pt |
Portuguese (Brazil) | br |
Romanian | ro |
Russian | ru |
Slovak | sk |
Serbian | sr |
Swedish | sv |
Thai | th |
Turkish | tr |
Ukrainian | uk |
Vietnamese | vi |
Persian | fa |
Belarusian | be |
OTP template types
The Viber Business Messages channel supports a number a predefined OTP templates. Each of these templates can be referenced by a corresponding unique ID. The supported templates are listed below, and more details can be found in their corresponding sub-sections:
- Basic OTP
- Basic OTP (valid for 5 minutes)
- Basic OTP (valid for a custome amount of time)
- OTP with custom code type
- OTP with custom code type and validity time
- OTP with business/platform name included
- OTP with business/platform name included and custom validity time
- OTP with details on OTP action/platform
- OTP with business/platform name and code reason included
Basic OTP
Template ID: 0aac888f-2ee2-4112-9659-1755a951966a
Your code is
{{pin}}
.Please don't share your code with ANYONE. We'll never call or message you and ask for it.
Parameter | Value type |
---|---|
pin |
text |
Basic OTP valid for 5 minutes
Template ID: c2cdc028-a48b-4187-bbaf-3aaa137b6e23
Your code is
{{pin}}
. It's valid for 5 minutes.Please don't share your code with ANYONE. We'll never call or message you and ask for it.
Parameter | Value type |
---|---|
pin |
text |
Basic OTP with code validity time
Template ID: bed0942f-e07e-4879-834b-29cc4cf3ec35
Your code is
{{pin}}
. It's valid for{{code_validity_time}}
minutes.Please don't share your code with ANYONE. We'll never call or message you and ask for it.
Parameter | Value type |
---|---|
pin |
text |
code_validity_time |
number |
OTP with type of code type
Template ID: 82ba31a3-db42-4e87-82e8-33fa92b9e5ed
Your
{{pin_type}}
code is{{pin}}
.Please don't share your code with ANYONE. We'll never call or message you and ask for it.
Parameter | Value type |
---|---|
pin_type |
text |
pin |
text |
OTP with code type & validity time
Template ID: 60d67b38-b9fb-444a-80e6-754447e010c6
Your
{{pin_type}}
code is{{pin}}
. It's valid for{{code_validity_time}}
minutes.Please don't share your code with ANYONE. We'll never call or message you and ask for it.
Parameter | Value type |
---|---|
pin_type |
text |
pin |
text |
code_validity_time |
number |
OTP with business/platform name
Template ID: c33cccaf-735f-4d62-8383-a76bf4999e2d
{{business_platform_name}}
: Your code is{{pin}}
.Please don't share your code with ANYONE. We'll never call or message you and ask for it.
Parameter | Value type |
---|---|
business_platform_name |
text |
pin |
text |
OTP with business/platform name & validity time
Template ID: 6c929cef-29b4-4349-bc9d-2a07bdbb6e43
Your
{{business_platform_name}}
code is{{pin}}
. It's valid for{{code_validity_time}}
hours.Please don't share your code with ANYONE. We'll never call or message you and ask for it.
Parameter | Value type |
---|---|
business_platform_name |
text |
pin |
text |
code_validity_time |
number |
OTP with details on OTP action/platform
Template ID: 210ee8a9-1ed5-43cd-96e4-65bba311ab40
Your one-time password for
{{business_platform_action_name}}
is{{pin}}
.Please don't share your code with ANYONE. We'll never call or message you and ask for it.
Parameter | Value type |
---|---|
business_platform_action_name |
text |
pin |
text |
OTP with business/platform name & code reason
Template ID: be56d97b-2a33-4c89-ac5f-f555a2c827d9
{{business_platform_name}}
: Your code is{{pin}}
. You got this code because{{code_reason}}
.Please don't share your code with ANYONE. We'll never call or message you and ask for it.
Parameter | Value type |
---|---|
pin |
text |
business_platform_name |
text |
code_reason |
text |