Discover The Benefits of a WhatsApp Chatbot
Creating a WhatsApp Chatbot with Twilio & Dialogflow:
In this article, I’m going to cover WhatsApp business and dive into creating a WhatsApp chatbot.
Why is WhatsApp So Important?
It's official, WhatsApp has one or two users… yes, that’s the understatement of the year!
In fact, WhatsApp has 1.5 billion users from 180 countries, which makes it the most popular instant messaging app worldwide. This messenger is handy for being secure, fast, and easy to use. It’s not just about the massive number of users though, it’s about engagement. WhatsApp users send about 65 billion messages per day, that is about 750,000 messages per second! WhatsApp usage shows no signs of slowing down.
WhatsApp for Business
In 2018 WhatsApp announced the official launch of their platform made for business.
This allows companies to communicate with clients using WhatsApp for Business instead of having to use their own personal numbers.
This will allow companies to automate, sort, and respond to messages on this incredibly popular messaging channel.
As of May 2018 WhatsApp for business had 3 million users.
Whatsapp is well known for protecting your data which includes chats, documents, status updates, photos, videos, voice messages, and calls via WhatsApp’s end-to-end encryption.
As a customer, you know you’re interacting with an officially approved business and all of your rights are protected by WhatsApp’s secure environment so its no doubt that the Whatsapp business client offering is becoming increasingly popular.
Whatsapp Business App
Business Profile
The WhatsApp business client has been built with the SME in mind. The app can help you provide customer support and deliver important notifications to your customers. These WhatsApp Business accounts help brands to improve brand loyalty. A business profile gives the company a familiar “face” and identity.
First off you need to grab the Whatsapp Business App for your mobile phone of choice which is free to download.
Users can create a business profile with helpful information for their customers such as their address, business description, email address, and website.
Steps - Update your business: Open the Whatsapp Business app → Open Settings → Open Business Setting → Business Profile.
Messaging Tools
The Business client provides some really useful automated messaging functionality.
Welcome Message
You can tailor your own greeting message and send to customers who message you for the first time or after 14 days of inactivity.
Quick Replies
Businesses can create their own standard quick reply messages to streamline their conversations and save time.
Away Message
You can tailor your own away message and reply when you are away.
Steps - Use messaging tools: Open the Whatsapp Business app → Open Settings → Open Business Setting → Select Away message/Greeting message/Quick replies.
Contact Labels
Another useful feature is the ability to organise chats and contacts with labels.
Steps - Use Labels: Open the Whatsapp Business app → Open Chat → Open Menu → Select Label chat
Statistics
The business app also provides statistics covering messages sent, delivered, read, received.
Steps - Access Statistics: Open the Whatsapp Business app → Open Settings → Open Business Setting → Statistics.
WhatsApp Business API
WhatsApp Business API is the enterprise offering for the platform.
Prerequisites
The prerequisites for using WhatsApp commercially via the WhatsApp Business API is to either apply for an own account directly from WhatsApp or to buy access from one of the official Solution Providers.
Access to the WhatsApp API has been limited, to say the least, the program is currently in a limited public preview, In fact, at the time of writing, there are only around 40+ companies listed as solution providers. You can still request access but there is no guarantee when/if this will be provided, I think Facebook will be favouring end client/solution provider applications with large estimated numbers of messages. Once you have gained access you will also have the technical challenges of getting set up. A quicker/simpler option is to use one of the solution providers for now. At least whilst you wait for your application access to be approved!
For the purposes of this article, we are going to look at using Twilio as our WhatsApp solution provider.
What's a WhatsApp Chatbot & What Are its Benefits?
A WhatsApp chatbot is similar to a Facebook Messenger Chatbot. When a user interacts with (WhatsApps) your number then the response is handled by your chatbot.
So what are the benefits?
- Customers can contact your business on their preferred platform, which they use daily
- It supports the ability to respond to customers questions right away
- You can reliably send mission-critical messages from delivery notifications to booking confirmations and delivery alerts
- Leads customers down the sales funnel by enabling them to take fast actions
- It builds trust and loyalty with customers
- Personalization of customer experience is possible by customizing the script that WhatsApp uses
- Customer communications are secure with an end to end encryption in WhatsApp
- You can send images, audio, video and pdf files via WhatsApp
Creating a WhatsApp Bike Shop Chatbot with Twilio & Dialogflow
We are going to look at building a WhatsApp chatbot for a bike shop.
The chatbot will be able to answer a simple set of bike shop related questions and book your bike in for a service.
We will use Dialogflow to create our chatbot and then connect this to the Twilio Sandbox for WhatsApp. The sandbox enables us to prototype with WhatsApp immediately, without waiting for the approval of our number.
There are some things to consider using the sandbox:
- You can only message users who have joined your sandbox. Messaging other users will fail.
- Load testing profile traffic is not supported
- The Sandbox numbers are restricted to 1 message every 3 seconds
- Sandbox numbers are branded as Twilio numbers
- You can only use pre-registered templates with the sandbox for outbound messages sent outside a WhatsApp session.
If you tell your customers that you will be using their email address and mobile phone number to send them information about your services and products, you should do that and nothing more.
Step1: Set Up Your Twilio Account
Signing up with Twilio is the next step and it's free with no need to provide a credit card, bonus!
- After opening the Twilio website, click the “Try the Sandbox today” button
- Sign up for Twilio account
- You will need to authenticate your email address.
- It's also useful to fill out the customisation clarification questions. “ Welcome! Let’s customize your experience!” However, it's not essential and you can just skip to the dashboard. We answered the questions and selected Send WhatsApp messages when asked: “ What do you want to do first?”
- Go to the Products section, then Programmable SMS and then navigate to the Twilio console
- You are then asked to activate your sandbox and agree to the WhatsApp terms of service.
- Go through the steps to set up your testing sandbox in the learn section.
- Try sending messages:
1. First send a message to the test number to link your number to the sandbox.
2. Then Send a One-Way WhatsApp Message. It's interesting to note that you must use a pre-approved template from WhatsApp.
3. Try sending Two-Way Messaging. Note 2-way messaging means you now have 24-hours between your Sandbox and your WhatsApp account, without the use of templates.
Step 2: Create your Dialogflow Agent
We won't go into detail here into how to create a Dialogflow agent you can learn more here there are plenty of good resources, we recommend taking a look at this.
If you want to use the agent we have built you can create an agent and use the restore from zip feature of the Dialogflow console to import our agent which you can download from here.
Step 3: Enable Twilio Integration in Dialogflow Agent
In the Dialogflow console → Under integrations → select Twilio (Text messaging) → in the settings window, there will be a Request URL (seen here in green).
Copy this URL and go to your Twilio account in the Sandbox configuration and paste into the “WHEN A MESSAGE COMES IN FIELD”.
Once you’ve done that go back to your Dialogflow Twilio settings window and input the rest of the account details: Make sure you have your Twilio API Credentials to hand, you will need Account SID, Auth Token, Phone number — Used to authenticate REST API requests.
Steps- API Credentials: Log-into Twilio → Open Dashboard → Open Settings → General.
Step 4: Test your Agent
At this point, if you have properly carried out all the steps you should be able to send a WhatsApp message to your number and the response will come from the Dialogflow chatbot. You can see ours below. Notice the sandbox limitation; Sandbox numbers are branded as Twilio numbers.
Adding Other Cool Functionality
There are loads of other cool features we could add to our Bike Shop WhatsApp chatbot, for example:
Use the Twilio WhatsApp API to send customers a notification that their bike is ready! You can read more from the API Reference here.
The WhatsApp message can be sent using a pre-provisioned template e.g.
Hi {{1}} your bike {{2}} is completed and can be collected when it's convenient, the cost for the work is {{3}}. Details of work carried out: {{4}}
Once your Twilio number has been enabled for WhatsApp you can also create your own templates.
Going into Production?
If you want to start using the Twilio API in production you need to enable your Twilio numbers for WhatsApp.
This involves initiating a request via Twilio.
Fill out this form to send the request. Once you have provisioned your numbers you also need to provide Twilio with your Facebook Business Manager ID.
Creating a WhatsApp Chatbot with Trengo
Trengo offers an omnichannel collaborative platform for its customers.
They provide the ability to support enquiries across multi-channels.
One of the cool things about their technology is that their platform supports Business WhatsApp and they have the ability to create chatbots on their platform which can be directly linked to a Dialogflow agent, which is great if you want to create a Dialogflow powered chatbot and easily connect to a WhatsApp number!
Conclusion
WhatsApp is a platform that connects billions of users every day and is now granting businesses endless possibilities for reaching and engaging with their massive audience.
Using WhatsApp for business, companies are now able to interact with customers on the platform that they love and already use.
Hopefully, you’ve enjoyed following the article and you can see the potential for using WhatsApp chatbots in your business.
We looked primarily at Twilio as the WhatsApp API provider, however, there are other providers which we will be looking to cover in the future, here are some of them:
About The Bot Forge
Consistently named as one of the top-ranked AI companies in the UK, The Bot Forge is a UK-based agency that specialises in chatbot & voice assistant design, development and optimisation.
If you'd like a no-obligation chat to discuss your project with one of our team, please book a free consultation.