Help Desk
  • Getting Started
    • ๐Ÿ™ŒWelcome to Whapi.Cloud
    • ๐Ÿ’ฐPricing
    • โ˜•Partners
    • ๐Ÿš€Getting started
    • ๐Ÿ‘จโ€๐Ÿ’ปAPI Docs
      • Developer hubs
      • Swagger environment
      • Postman collection
  • Sending
    • Introduction
    • Send text message
      • Whatsapp API send message PHP
      • Whatsapp API send message Python
      • Whatsapp API send message Node JS
      • Whatsapp API send message ะก#
      • Whatsapp API send message Java
      • API integration with VB6
      • Whatsapp API send message GO (Golang)
    • Send video, audio, image, document
    • Send Group message
    • Send post to WhatsApp Channel
    • Send message with Buttons
    • Send Emoji
    • Overview of other methods for sending
      • Send Voice message
      • Send contact (vCard)
      • Send message reactions
  • Receiving
    • Introduction
    • Webhooks
      • Our webhooks (Tracked events)
      • Where to Find the Webhook URL?
      • Set the webhook link to the channel
      • Detailed webhook settings
      • How to check the webhook?
      • Incoming webhooks format
        • Incoming message
        • Sent message
        • Chats
        • Groups
        • Account and device status
        • Other
          • Presences
          • Views of stories (statuses)
          • Story (status) from your contacts
          • Calls
      • Receive messages
        • Receive WhatsApp messages using PHP
        • Receive WhatsApp messages using Node js
        • Receive WhatsApp messages using Python
    • HTTP API
      • Retrieve a Specific User's Chat History
      • Get a full-size picture in the response
      • Get order items
      • Get a profile picture of a chat or user
    • File expiration period
  • Groups
    • Send Group message
      • Mentioning all participants in a WhatsApp group
    • Get list of group members
    • Add new member to Group
  • Channels
    • Send post to WhatsApp Channel
    • Get messages from Channels
    • Get votes from polls in the Channel
  • Communities
    • Introduction
    • Create a community
    • Add a member to a community
    • Send announcement
    • Get info on community participants
    • Add a group / Exclude a group from the community
  • Account
    • Setting "Auto Download"
    • Customizable Webhook Headers
    • How to find out the IP channel
    • How to Delete a Channel
    • Add Business Info to Invoice
  • Source code
    • WhatsApp ChatBot
      • WhatsApp Python Bot
      • WhatsApp PHP Bot
      • WhatsApp Node JS Bot
      • WhatsApp Java Bot
    • WhatsApp API Google Sheets
    • WhatsApp Phone Number Checker
    • Request Distributor (Balancer)
  • FAQ
    • Chat ID. What is it and how to get it?
    • Current status of Buttons on WhatsApp
    • How to send a paragraph (line break)
    • Inactive Links in WhatsApp Messages
    • WhatsApp Text Formatting
    • Checking if the number has Whatsapp
    • Specifics of sending messages to numbers of different countries
    • Why aren't participants being added to the group?
  • Does WhatsApp API Work with the Phone Turned Off?
  • Hints
    • Android Emulators
    • Virtual Numbers for WhatsApp
    • How to use polls as buttons?
    • How to check who blocked you in Whatsapp?
    • Setting up a WhatsApp proxy
  • Integrations
    • Make.com
      • Ready-Made Scenarios
        • WhatsApp & Whisper API: Voice-to-Text Integration
        • Automated WhatsApp Group Message Forwarding in Make.com
      • Request Scenario Setup
    • Pabbly Connect
    • Google Contacts
    • DialogFlow
    • n8n
  • Tools
    • WhatsApp Number Checker
    • Automatic warm-up module
    • WhatsApp Activity Safety Meter
    • Residential Proxies from Whapi.Cloud
  • Troubleshooting
    • Couldn't Link Device โ€“ WhatsApp QR Code or Pairing Code Fails
    • Channel status โ€œSYNC_ERRORโ€
    • Not getting a READ status on webhook
    • 429 (Too Many Requests) - Soft Ban
    • โ€œWaiting for this message. This may take a whileโ€ โ€“ WhatsApp Message Error
    • Missing push notifications after connecting to API
  • Blocking
    • How to not get Banned?
    • How to do mailings without the risk of being blocked?
    • If My Number Is Banned, Can It Be Restored?
    • Unlocking Your WhatsApp Number
    • Connecting a New WhatsApp Number After a Ban: Steps and Recommendations
    • Warming Up New Phone Numbers for WhatsApp API
  • Partner Documentation
    • Introduction
    • Partner Dashboard Overview
    • Partner Program Guidelines
      • Workflow: Step-by-Step
      • Billing for Partners
      • Allocating Days to Customer Channels: Best Practices & Guide
      • Interface for channel management
    • Partner Documentation
      • Channel creation
      • Changing channel mode
      • Channel extension
      • Channel deletion
      • Getting the list of channels
      • Notices of end of days on balance
Powered by GitBook
On this page
  • Build Your Dialogflow Agent
  • Connecting integration in dashboard
  • Principle of integration of WhatsApp API and DialogFlow
  • API Endpoint

Was this helpful?

  1. Integrations

DialogFlow

Build a Dialogflow-WhatsApp Chatbot

PreviousGoogle ContactsNextn8n

Last updated 15 days ago

Was this helpful?

There are times 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.

Build Your Dialogflow Agent

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:

Connecting integration in dashboard

  1. Connect any number to Whapi.Cloud.

  2. Go to your personal cabinet of Whapi.Cloud to the Integrations section and select DialogFlow there.

  3. Get the token by granting permission to our app to process your bot in DialogFlow.

  4. Use the API documentation to work with DialogFlow.

Warning, this is not a chatbot builder. This is an integration built for developers!

Principle of integration of WhatsApp API and DialogFlow

This integration does not rely on a webhook connection! Instead, it acts as a communication bridge between your WhatsApp channel and your DialogFlow bot:

  1. You receive an incoming message from the client via our webhook.

  2. You forward the message to DialogFlow through a special API request.

  3. DialogFlow generates a reply based on the conversation context.

  4. You take the botโ€™s reply and send it back to the client using our API.

In other words, DialogFlow only generates the reply โ€” you are fully responsible for delivering the message to the customer via your WhatsApp API channel.

Key points to set up:

Thus, you must build your own lightweight forwarding logic to manage the flow between the client, DialogFlow, and WhatsApp.

API Endpoint

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:

{
    "token": "YOUR_Google_auth_TOKEN",
    "message": "Hello",
    "session": "919984351847", // Use a session to save the context
    "bot_id": "YOUR_DialogFlow_ProjectID"
}

You can pass any value to the โ€œsessionโ€ parameter, but it makes the most sense to use the phone number of the person you are chatting with. This parameter is necessary to preserve the context in the conversation.

In response you will receive a result generated by DialogFlow, use it to send a message from the bot to your clients!

Enable and configure a webhook to receive client messages: ;

Use the DialogFlow integration endpoint to send incoming messages and get the botโ€™s reply: ;

Forward the bot's response back to the client using our sending methods: ;

Webhook setup guide
Send text message guide
DialogFlow integration API guide
Dialogflow
Dialogflow - Google
Don't forget to use your authorized channel token
Response by DialogFlow
Logo