Gupshup - WhatsApp Interactive Messages

2.4k views Asked by At

We are trying to send WhatsApp messages with quick reply buttons via GupShup API. In this case we are using WhatsApp session messaging, not template messaging.

Sample message looks like the following

You can now view your Account Balance or Mini statement for Account ending with 2343 simply by selecting one of the options below. | [View Account Balance] | [View Mini Statement]

But when we send using GupShup Single API, the buttons doesn't appear in WhatsApp. Instead, the square brackets appear as it is.

Any one got an idea, why this is happening?

2

There are 2 answers

0
Aniket On

it's better to use a callback function instead of API. Just add a callback url in your app settings and it'll be good. But can you pls elaborate your problem , i am unable to understand

3
Elf On

The same thing happened to me while testing. Our backend system would make an API call to Gupshup POST /sm/api/v1/msg. We were sending a pre-approved template with buttons.

Instead of receiving a WhatsApp message with buttons, we would receive the message with square brackets.

In my case, template messages were not turned on for that specific Gupshup app.

Please go to your Gupshup dashboard, check app settings. There is a section "Template Messaging" - this has to be set to "Enabled" in order to send buttons

If that fails, check that the API call has isHSM set to true so Gupshup can match the template (see Gupshup API documentation)

EDIT:

While checking the question again I noticed that you are sending a "session" message. As far as I know, buttons are only available inside a template. So you have to submit a template with buttons and then you can use it. I just tested with regular messages and buttons are not formatted as buttons. Both Gupshup and WhatsApp mention buttons only in the context of templates.

Gupshup article

Interactive message templates expand the content you can send recipients beyond the standard message template and media messages template types to include interactive buttons

...

These buttons can be attached to text messages or media messages (currently, with media this is not supported our platform).