Skip to main content

inlineButtons

inlineButtons are displayed inside the chat as chatbot responses. By clicking on the inline button callback_data or URL can be sent.

caution
Only certain channels support inline buttons.

Syntax

  • The name of each button and each callback_data or URL that corresponds to that button is specified in braces {} after the tag:
    • text — button name,
    • url — link to a website,
    • callback_data — callback data.
info

Please note that the text key is required for objects passed in the inlineButtons tag.

inlineButtons:{
text:"button name", // Required
url:"link to a website"
}
inlineButtons:{
text:"Subscribe to updates", // Required
callback_data: "Subscribe"
}

Channel restrictions

  1. Telegram:

    • The button’s text maximum length is 15 symbols. Button text outside the limit moves to the next line.
    • If the size of the data in callback_data exceeds 64 bytes, the exceeded data will be cut.
    • For each set of inline buttons, there should be at least one text reply in the bot message.
  2. Viber:

    • The maximum number of button rows is 7.
  3. i-Digital: WhatsApp:

    • Text buttons and inline URL buttons cannot be combined in one state.
    • The maximum number of buttons in a single message is 2.
    • The button’s text maximum length is 20 symbols.
    • There can be only one button in the message with a link to website.
    • There can be only one button with a phone number in a message.
    • The buttons which are added to the first bot message in the messaging campaign must be registered in advance. Other buttons do not require registration.

How to use

caution
The buttons and inlineButtons tags cannot be applied to a single response specified in the a tag simultaneously. Instead, several responses can be added to a single state and different types of buttons can be applied to each response.

Telegram

state: inlineButtons
q!: Instruction
a: Check out the instruction on our website.
inlineButtons:
{text:"Go to website", url:"https://example.com"}

i-Digital: WhatsApp

Template

To add buttons to the first bot message in the messaging campaign for the i-Digital: WhatsApp channel, you need to register them as a template in i-Digital.

In the template, you need to specify the message text and the button content: a URL or a phone number.

Message textButton nameURL
Contact us.Go to websitehttps://example.com
Button template with a phone number
Message textButton namePhone number
Contact us.Call+7 890 123 45-67
tip
To receive a template for buttons, contact your account manager.

Script

 state: inline
q!: JA Instruction
a: Check out the instruction on our website.
inlineButtons:
{text:"Go to website", url:"https://example.com"}