Here to create dynamic URL buttons we need to set the type of button as âweb_urlâ
Also, there will be two more properties for the web_url button named âweb_urlâ and âbrowser_windowâ
The âweb_urlâ property will set the redirection URL on the button on which the user will click and it will redirect to that URL
âbrowser_windowâ is used to set the new redirected URL will open in the âsameâ window or in the ânewâ window. The value of this property will be from âsameâ or ânewâ
To generate dynamic cards from variables you need to provide the path as we have done in buttons in form of a look-up path for JSON
You can also provide a path to description and image to generate dynamic Cards and buttons as we do it for the title of cards and buttons in the carousel
List (for WhatsApp)
We also can generate a list dialog using this code block for WhatsApp only
We need to give the type as a list and provide other properties of the list
Here section_title refers to the section in the list, it is handled on the WhatsApp side to categorise buttons in one section
Buttons having the same section name will fall under one section
Dynamically Generated list Example
{
"type": "list",
"data_variable": "data",
"properties": {
"goal": "This is Goal",
"body": "This is List body",
"list_title": "This is list",
"button_properties": [
{
"section_title": "Buttons",
"title": "result[*].title",
"description": "result[*].description"
}
],
"footer": "This is footer",
"header": "This is header",
"error_message": "Please select valid button"
},
"variable": {
"name": "list",
"type": "non_contact"
}
}
To generate dynamic buttons using variables we need to specify the lookup path for the JSON to the title and description
The options dialog is similar to the button dialog on the web, but it is available to generate buttons for WhatsApp only
Here button type is also the same as buttons for web channels just difference is that it can not generate web buttons as compared to web channels as WhatsApp does not provide support for web buttons
Reply buttons are only available on the WhatsApp channels
It provides the same functionality as the reply button in WhatsApp, you can provide the functionality to attach different headers available on the WhatsApp side
We can also insert a footer and error message in the reply button dialog
Dynamically Generated Reply Buttons Example
{
"type": "reply_button",
"data_variable": "data",
"properties": {
"goal": "optional static",
"title": "This is the Reply Button section",
"button_properties": [
{
"button_type": "branch",
"title": "result[*].title"
}
],
"header": {
"type": "text",
"text": "This is a reply button header"
},
"footer": "This is reply button footer",
"error_message": "Please select from the above buttons only"
},
"variable": {
"name": "reply_button",
"type": "non_contact"
}
}
To generate reply button from variable response one need to provide look up path for JSON to the title property. Other properties are static so we can not set path to other property
this property refers to the type of dialog you need to generate like a button, carousel, etc.
data_variable
If you want to generate dialogs from JSON data(LikeService Call Dialog API response) this is a mapping of the variable that internally generates dialogs from that variable values(If any).
properties
This refers to particular dialog properties that every dialog uniquely contains.
goal
This property is used for goal tracking in the system. This is an optional property.
title
It refers to the title of the dialog. This is a required property.
button_properties
This property is used to configure the buttons generated by each dialog.
variable
This property is used to store selected response in a variable and it also defines the type of variable(Like contact or non_contact)(Note: This will only work if the variable is already defined in bot-flow)