Viber channel – transactional
The Viber channel object for Advanced transactional. It goes into the channel object under the viber key - see Cascade.
Promotional messages use a different Viber object under the same key - it carries a button and an image instead of templates. See Viber – promotional.
Viber object
| PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
|---|---|---|---|
| text | Text of the Viber message. Overrides the top-level text, see Which text is used |
No | null |
| sender | Registered Viber sender. Needs to be registered first. For registration contact support here | Yes | - |
| expiration | Time limit in seconds after which the next channel in the cascade is used. Values below 60 are ignored and replaced by the default |
No | 300 |
| template_id | Key of an approved Viber template with a leading @ (e.g. @order-confirmation), or the template ID at Viber. When it is filled in, the message is sent as a template and text is not used |
No | null |
| template_language | Code of the template language version. Most languages have a two-letter code (cs, en), the exceptions are fr_FR, es_ES, pt_BR, pt_PT, zh-Hans and zh-Hant |
No | en |
| template_parameters | Associative array of template parameters, for e.g.: {"code": "0451"} |
No | [] |
template_id is what switches the message to a template - not use_template. The use_template parameter is still accepted for backward compatibility, but on this endpoint it has no effect.
Every transactional Viber message has to run on a template approved by Viber in advance. How to register a template is described on the Viber template registration page.
Without template_id the message is not billed at the transactional rate. A Viber message sent through this endpoint without a template goes out at the promotional rate; only a message running on an approved template is billed as transactional.
Example of full request
Viber first, SMS as the fallback. The top-level text is used by both legs of the cascade; expiration says how long we wait for Viber before switching to SMS.
The same message as an approved template. template_id switches the Viber leg to the template, so the top-level text reaches only the SMS leg - and the Viber leg is billed at the transactional rate.
The response is the same for every channel - see Advanced transactional.
Thank you for your feedback.