Keypad Menu
Sending Menu to Chat
For both Normal and Inline Keypad menus, the menu structure definition can be sent to chat in two ways:
- separately with specific JSON, or
- associated with a specific message in the chat. The app will define the structure and associate the reference menu with that specific message.
Using Menu
Every menu has a reference identifier. Menus can be called and used in many ways:
-
Associate a menu reference with a specific message to chat. When you associate a menu reference with a message, the message will reference this menu. If the menu is already defined, it will be displayed as an inline keypad menu.
-
Associate menu reference with "start menu button." When the user presses the start menu button, the menu will be displayed as a normal menu.
-
Menus can also be referenced from any other menu button by defining the menu reference in the "next_menu" field.
All keypad menus can be used online or offline. If the app is offline, the menu can still be used offline, since the definition for the menu structure is stored in the app. In that case, the menu can be used for browsing and deep linking to other chats.
Menu Button Properties
Each menu is composed of a set of buttons with a set of properties. When the user provides formal input or clicks a button, the app will send the respective command.
Button Call Back
A callback command is sent into the "button_callback" field when a button is pressed by the user. For example, the bot can use the callback command as an identifier for this button action. It is the responsibility of the bot developer to maintain unique callback commands for all defined buttons.
Button Inquiry
A button can query some information from the app with the permission of the user. Examples of supported button queries:
- Location: Ask the user permission to inquire about geo-location, and if permission is granted, provide the bot with the geo-location coordinates of the device.
- Contact: Ask the user permission to inquire about the mobile number, and if permission is granted, provide the bot with the mobile number of the device.
Buttons URL
Bots can define Button URL. When the button is pressed, the URL link will be opened.
All buttons with a defined URL will have a small arrow icon to indicate that pressing this button will open an external link.
Button next menu
When the button is pressed, the app will display the next menu referenced within that button. This function is a great help for designing browsing menus and offline menus.