DialogFlow
Build a Dialogflow-WhatsApp Chatbot
Last updated
Build a Dialogflow-WhatsApp Chatbot
Last updated
There are times and channels where the use of Natural Language Processing (NLP) can positively impact the customer experience. One such channel is the world's most popular messaging app, WhatsApp. Therefore, this article will show you how to build a chatbot using Googleโs NLP software Dialogflow in combination with our WhatsApp API.
First and foremost, you need to create your Dialogflow agent. In short, โagentโ is Dialogflow is, essentially, the bot you are building. We have to start here:
Next, create the name, pick the time zone and language for your agent. Select your Google Project. It's required. This ID will be used later.
Its main building components are intents which help the agent identify what the user actually wants to do.
Each intent requires training phrases (all the different ways a user can ask for the same thing) and, of course, the responses (always create more variations to keep repeat conversations natural.
When all that is set up, go to the intents section using the menu on the left and start creating the intents.
Create phrases (as many as you can) that users will write to you:
Prepare the answers (preferably a variety of them) that the bot will use in its response:
Connect any number to Whapi.Cloud.
Go to your personal cabinet of Whapi.Cloud to the Integrations section and select DialogFlow there.
Get the token by granting permission to our app to process your bot in DialogFlow.
Use the API documentation to work with DialogFlow.
Warning, this is not a chatbot builder. This is an integration built for developers!
POST https://tools.whapi.cloud/integrations/google_dialog_flow/send
The request will require specifying a Header with the name Authorization and the value "Bearer {your_channel_token}"
Body:
In response you will receive a result generated by DialogFlow, use it to send a message from the bot to your clients!