Building a WhatsApp chatbot in 5 minutes without coding
Chatbots are on the rise. There are already plenty of more or less useful chatbots out there, most of them based on Facebook Messenger. If you, however, reside in Europe, India, South America or Africa, it is likely that you are using WhatsApp as your preferred communication channel (stats). Nice, so what might be a useful case for a chatbot on WhatsApp? Since WhatsApp is currently focussing on customer service as described in their guidelines, let’s build a bot that helps to pre-qualify service inquiries.
What are the prerequisites?
The prerequisites for using WhatsApp commercially via the WhatsApp Business API is to either apply for an own account directly from WhatsApp, which currently is extremely hard to get or to buy access from one of the official Solution Providers. I can recommend the second option because it is quite challenging to set the whole thing up from a technical perspective. As the name already suggests, it is only an API without a graphical user interface.
When you have such a Business Account, you can add a phone number to it and start sending and receiving messages. A WhatsApp Business profile looks like this (German language):
Building the bot
In this little showcase, I am using MessengerPeople’s platform for building the chatbot. MessengerPeople is one of the official WhatsApp solution providers and offers a ticket system for manual agent-lead chats as well as a graphical chatbot builder interface for automating conversations.
Just a quick note: It is not our goal to build a super-intelligent digital assistant that can answer every question one can think of! Our goal is to build a little helper that can serve in a clear and narrow defined use case. This is why it is essential that we let the bot lead the conversation. The bot always needs to give hints about how the conversation can go on. Last but not least let me mention that many ways lead to Rome. This is only one tiny example with very limited functionality.
Ok, enough theory! Let’s start building! MP’s chatbot-builder interface is very simple and intuitive. On the left side, you add so-called user questions, these are the keywords and phrases the bot should react on. On the right side, you add the corresponding bot answers.
Let’s begin with a welcome message and an introduction. We are adding some keywords like hello, hi, howdy as user questions. You can also handle typos by adding misspelled words and phrases. Then we let the bot introduce himself and immediately give options to choose from. WhatsApp offers very limited formatting options. We can enclose a word in two stars to make it bold. Of course, we can also add Emojis.
The bot gives the user 3 options: products, news and chat with an agent. We also added short cuts for simplifying the reply-process and optimizing the user experience. So, now we can add the corresponding dialogues to these 3 options. Let’s start with the product information. Besides the shortcut “1” we are also adding the keywords “product” and “products”. Of course, you could add here as many synonyms or whole phrases as you like.
Then we add the second dialogue in the same way for the news section with the shortcut “2”. We can also put a link to a web page with more details in the bot answer. A link shortener will automatically shorten all links and make tracking of clicks possible. Please note that you cannot use HTML in WhatsApp, so you cannot add and style for example an <a> tag. The only way is to add a pure URL.
For the third dialogue with the shortcut “3”, we add a special action to the bot answer “Handover to agent”. What happens here? So far the whole conversation was completely automated. At this point, the chatbot stops working and opens a ticket for a human agent. We call this a hybrid bot. The agent can then pick up the ticket and manually reply to the customer. It is also possible to define custom skills like “sales”, “support”, “hr”, etc. so the bot can autoroute the request to the right department.
Our whole configuration looks like this:
Now it is time to test our little companion! I am using WhatsApp Web for the development and testing of chatbots because it is a convenient way to work with WhatsApp in your browser.
Nice, isn’t it? Finally, let’s have a look at the backend ticket system where this request arrived. This is the agent view:
Of course, the chatbot has many more capabilities than this simple question and answer game. It can, for example, collect and store data to user profiles. It can pull information from external data sources via API. It can handle dependencies and respond correspondingly, for example, “did this user already provide his name, then address him with his name” or “user answered question 1 with A, so proceed with question 4”. It can also send multiple messages in a chain with a defined delay and of course, it can send media like images, video, audio, and pdf.