WhatsApp Business & Creating a WhatsApp Chatbot

, ,

 

Creating a WhatsApp chatbot with Twilio and 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, that 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

Message us on WhatsApp- 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.

WhatsApp Business Profile

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

WhatsApp 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

WhatsApp 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.

WhatsApp Contact 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.

Girl using WhatsApp chatbot

So what is a WhatsApp chatbot and what are the benefits?

A WhatsApp chatbot is similar to a Facebook Messenger Chatbot. When a user interacts (WhatsApps) your number then the response is handled by your chatbot. So what are the benefits?

Bikeshop chatbot

Creating a WhatsApp BIKE SHOP Chatbot with Twilio and 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:

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 — Setup 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!

  • Try sending messages:
    1. First by sending 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.

Step2- 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 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.

Step3- 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).

Dialogflow Console

Copy this URL and go to your Twilio account in the Sandbox configuration and paste into the “WHEN A MESSAGE COMES IN FIELD”.

Dialogflow Twilio

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.

Step4- Testing 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.

WhatsApp Chat Conversation

Our WhatsApp chatbot in action

Adding some other cool functionality

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.

Conclusion

https://www.clickatell.com/products/whatsapp

https://www.messagebird.com/en/whatsapp

https://www.nexmo.com/products/messages/whatsapp

https://sendbee.io

Interested in your own WhatsApp chatbot?