DIALOGFLOW RESPONSES FOR WHATSAPP CHATBOT

Learn to build a basic text response for your WhatsApp chatbot.

Gautam Rajesh Shelley avatar
Written by Gautam Rajesh Shelley
Updated over a week ago

Table of Contents



Basic Text Responses

To build a basic text response for your WhatsApp chatbot, we use Default Text Response from the Dialogflow. We can create variants for a simple text message in the Default Text Response.

Maximum file size allowed for all media photos videos or voice messages to be sent or forwarded through WhatsApp is 5 MB on all platforms.
Maximum file size allowed for all media photos videos or voice messages to be sent or forwarded through WhatsApp is 5 MB on all platforms. 1

Add A New Line

We separate texts for two consecutive lines using the ‘Shift + Enter’ Keys to add a new line in a text response. Text written after the ‘Shift + Enter’ Keys will be displayed in the next line of the same message in the WhatsApp Chat.

New Text Message Response

To add a new message or bubble in text responses, we separate texts for two consecutive messages using two semicolons ‘;;’. Text written after ‘;’ will be displayed as a separate message in the WhatsApp Chat.

Bold/Italic Text

To create a text message bold, we put that text inside two asterisk characters, eg. *BoldText*. Text written between two asterisk characters (do not give spaces between * and text) will be bold in the WhatsApp response.

To create a text message italic, we put that text inside two underscore characters, eg. _ItalicText_. Text written between two underscore characters (do not give spaces between _ and text) will be in Italic style in the WhatsApp response.

Use Emojis In Responses

We can use emojis and emoticons by simply adding them to our text responses. To Access Emojis:
Windows – Press ‘Windows Key’ + ‘Semicolon’
MacOS – Press ‘Command’ + ‘Control’ + ‘Spacebar’

Send A Media/Doc Response

In order to send media like images, videos, Gifs or files like .docs, or .pdf, we’ve to follow a certain format.

We use the Basic Card From Google Assistant Response to create a media/file response.

The maximum file size allowed for all media (photos, videos or voice messages) to be sent or forwarded through WhatsApp is 5 MB on all platforms.

We primarily use file URL, alt text and a file type ( IMAGE for an image, VIDEO for videos and FILE for documents).

med

Q How to set up Text Quick Reply using Dialogflow?

To send a simple text quick reply, you'll need a combination of two Dialogflow responses:

  1. Text response

  • Add a simple text message which you want as a body message.

  • A maximum of 1024 characters is supported.

2. Suggestion Chip

  1. Add suggestion chip response inside the Google Assistant section.

  2. You can add a maximum of 3 Quick Replies.

  3. Each quick reply should be a unique entry.

  4. Each option can be a max length of 20 characters.

Q How to set up Media Quick Reply?

To attach an Image, Video or File along with Quick Replies, again a combination of two Dialogflow responses are needed:

  1. Add a Basic Card

    • Add a basic card and fill in the details as per media requirements.

    • File URL must be valid & publicly accessible for WhatsApp.

    • Choose Alt text for the media.

    • The title will be ignored.

    • File Type must include either an IMAGE, VIDEO or FILE.

    • The description holds the card body.

    • A maximum of 1024 characters is supported.


  2. Suggestion Chip

Add suggestion chip response inside the Google Assistant section:

  • Make sure to keep a maximum of 3 Quick Replies.

  • Each Quick Reply should be a unique entry.

  • Each Quick Reply can be a max length of 20 characters.

Q How to set up List Messages in WhatsApp?

To set up List Messages, you only need one Dialogflow response:

Table Card

  • Add a Table card and fill in only the necessary details.

  • Leave the first two fields blank.

  • In the title field, give the Message title. A maximum of 60 characters is supported.

  • In the subtitle field, give Body text i.e. body of the message. A maximum of 20 characters is supported.

  • In the 'web link title' field give the Link button title. A maximum of 20 characters is supported.

Before creating a List Message, here's what you need to know:

  1. Section Title - Contains the Title of the section. Appears like this👇



  2. Option Title - Here, you can list down the multiple options for your product.

3. Option Description - Here comes the description of your product. Adding a description is optional.

How to create a list?

  • Create a table with 4 columns.

  • In Section, give the section name and provide the same value for the options you want to group together. The maximum length of each option can be 24 characters. Check the below example for a clear understanding.

  • No emojis are allowed in the Section title.

  • Option title is compulsory and holds the name of each option. Ensure that each option within a section is unique.

  • The maximum length of each option can be 24 characters.

  • No emojis are allowed in the option title.

  • Option description is optional and holds details of each option. The maximum length of the optional description can be 72 characters.

  • Postback text is optional and holds details of each option. The maximum length of the description can be 72 characters.

Things to note:

  • You can add a maximum of 10 Options.

  • These options can be under a single Section or each option under a different section.

  • Each section can have 1-10 options.

Note**

If you want to create a List Message without any section, leave the section title field blank in all the options.

Here's an example of a List Message👇‍

Example of a List Reply

While creating Table in Dialogflow:

In the above image:

  1. In the Title of the List Reply, we've put "Sparx Shoes".

  2. In the subtitle, we've put "Explore multiple options".

  3. In the web link title, we've added the Button Name, "Explore"

  4. In the Section title, we've added "Shoes". This section covers the name of the shoes.

  5. In the option title, we've added "Shoes Size" & in the description, we've shown the colour.

So, you can configure the table according to your use case.

After adding this, press save!

Now, let's see how this List Reply appears on WhatsApp!

"Sparx Infinity" which we added in two separate rows, club together in one. So does "Sparx Buddy".

So, if a user wants to buy a Sparx Infinity Shoe of Size 7, they will choose the option & hit send.

Points To Remember

  1. We always use Default Response to create text responses.

  2. Basic Card from Google Assistant’s Responses will be used to create media/doc responses.

  3. We can not use Custom Payloads or any other responses to create WhatsApp Messages.

  4. In order to send text responses through Webhook, we have to customise text responses as shown above.


Did this answer your question?