Back to HomeDialogflow

Dialogflow Messenger and WhatsApp Integration Complete Guide

11 min min read
#Dialogflow#Messenger#WhatsApp#Facebook#Meta#Chatbot

Dialogflow Messenger and WhatsApp Integration Complete Guide

Dialogflow Messenger and WhatsApp Integration Complete Guide

If your customers are distributed globally, just having a LINE Bot isn't enough.

Facebook Messenger has over 1 billion monthly active users globally, and WhatsApp has over 2 billion. These two platforms are essential channels for reaching international customers. The good news is that Dialogflow can integrate with these platforms simultaneously, serving all customers with the same conversation logic.

This article teaches you how to integrate Dialogflow with Messenger and WhatsApp to build a cross-platform AI customer service system.

If you're not yet familiar with Dialogflow basics, we recommend first reading the Dialogflow Complete Guide. For Taiwan users primarily using LINE, refer to Dialogflow LINE Bot Integration Tutorial.


Supported Communication Platforms Overview

Dialogflow supports multiple communication platform integrations, but integration methods differ between versions.

PlatformES SupportCX SupportIntegration Difficulty
Facebook MessengerBuilt-inRequires Custom BuildMedium
WhatsApp BusinessRequires Custom BuildNative SupportHigher
InstagramRequires Custom BuildRequires Custom BuildHigher
TelegramBuilt-inRequires Custom BuildLow
SlackBuilt-inRequires Custom BuildLow
LINEBuilt-inRequires Custom BuildMedium

Key Differences:

  • Messenger: ES has built-in integration, CX requires custom development
  • WhatsApp: Only CX has native integration, ES requires custom development

If your main requirement is WhatsApp, you must choose Dialogflow CX. For detailed version comparison, refer to Dialogflow CX vs ES Complete Comparison.

Illustration: Platform Integration Architecture Diagram

Scene Description: An architecture diagram with Dialogflow Agent in the center, surrounded by platform icons including LINE, Messenger, WhatsApp, Telegram, Slack. Arrows indicate bidirectional communication, with support status labeled below each platform like "ES Built-in" or "CX Native."

Visual Focus:

  • Main content clearly presented

Required Elements:

  • Based on key elements in description

Chinese Text to Display: None

Color Tone: Professional, clear

Elements to Avoid: Abstract graphics, gears, glowing effects

Slug: dialogflow-multi-platform-architecture


Facebook Messenger Integration

Messenger is Facebook's instant messaging service, suitable for businesses with Facebook Pages.

Creating a Facebook App

  1. Go to Meta for Developers
  2. Log in with your Facebook account
  3. Click "My Apps" > "Create App"
  4. Select App type: "Business"
  5. Enter App name and contact Email
  6. Click "Create App"

Setting Up Messenger Product

  1. In the App Dashboard, click "Add Product"
  2. Find "Messenger" and click "Set Up"
  3. In the "Access Tokens" section, link your Facebook Page
  4. Click "Generate Token" and save it

Important: The generated Page Access Token is sensitive information—store it securely.

Webhook Configuration

Dialogflow ES Integration:

  1. In Dialogflow Console, enter your Agent
  2. Click "Integrations" > "Facebook Messenger"
  3. Enter the following information:
    • Verify Token: A custom string (e.g., my-secret-token)
    • Page Access Token: The token just generated
  4. Click "Start"
  5. Copy the displayed Callback URL

Return to Meta for Developers:

  1. In Messenger Settings, find "Webhooks"
  2. Click "Add Callback URL"
  3. Enter:
    • Callback URL: The URL provided by Dialogflow
    • Verify Token: Your custom string
  4. Click "Verify and Save"
  5. Subscribe to Webhook events: messages, messaging_postbacks

Permissions and Review

Messenger Bots require Meta review before public release.

Before Review:

  • Only App administrators and test users can use it
  • Sufficient for development and testing

Permissions Requiring Review:

PermissionPurposeReview Difficulty
pages_messagingReply to messagesMedium
pages_manage_metadataManage PageMedium

Review Preparation:

  • Write clear Bot purpose description
  • Prepare screen recording demonstrating Bot features
  • Ensure privacy policy page exists
  • Ensure terms of service page exists

Review Time: Usually 1-5 business days

Illustration: Facebook App Settings Screenshot

Scene Description: A screenshot of Meta for Developers showing Messenger settings page. The screen highlights Webhook Callback URL and Page Access Token locations, with arrows pointing to key fields.

Visual Focus:

  • Main content clearly presented

Required Elements:

  • Based on key elements in description

Chinese Text to Display: None

Color Tone: Professional, clear

Elements to Avoid: Abstract graphics, gears, glowing effects

Slug: facebook-app-messenger-setup


WhatsApp Business Integration (CX Exclusive)

WhatsApp is the world's most used messaging app, with extremely high penetration especially in Europe, South America, and Southeast Asia.

Note: WhatsApp Business API integration is a Dialogflow CX exclusive feature—ES doesn't support native integration.

WhatsApp Business API Application

WhatsApp Business API can't be self-applied like LINE or Messenger; it requires going through the official process.

Application Methods:

  1. Direct Application: Apply through Meta Business Suite
  2. Through BSP: Use a Business Solution Provider (like Twilio, 360dialog)

Application Requirements:

  • Have legitimate business registration
  • Have an official business phone number
  • Comply with WhatsApp Commerce Policy

Application Process:

  1. Create Meta Business account
  2. Verify business information
  3. Apply for WhatsApp Business API access
  4. Set up WhatsApp Business Profile
  5. Verify phone number

Review Time: 1-4 weeks (depending on company size and verification documents)

CX Native Integration Setup

Dialogflow CX provides native WhatsApp integration, setup is relatively simple.

In Dialogflow CX Console:

  1. Enter your CX Agent
  2. Click "Integrations"
  3. Select "WhatsApp"
  4. Link your Meta Business account
  5. Select the WhatsApp Business phone number to use
  6. Click "Enable"

After Setup:

  • Messages sent to that number automatically forward to Dialogflow CX
  • CX responses automatically send back to WhatsApp

Message Template Management

WhatsApp has strict messaging policies—proactive broadcasts require pre-approved "message templates."

Message Types:

TypeRestrictionsPurpose
Session MessageWithin 24 hoursReply to user messages
Template MessageRequires reviewProactive broadcasts, expired replies

Template Review Notes:

  • Cannot contain promotional content (unless specifically permitted)
  • Variables (like name, order number) must use {{1}} format
  • Must provide sample values
  • Review time approximately 1-2 days

24-Hour Conversation Window Rules

WhatsApp has a "conversation window" mechanism that affects how messages are sent:

User-Initiated Conversation:

  • Starts from when user sends first message
  • Business can reply unlimited times within 24 hours
  • After 24 hours, must use Template

Business-Initiated Contact:

  • Must use approved Template
  • Each Template message opens a new 24-hour window

Practical Recommendations:

  • Guide users to initiate contact next time at end of conversation
  • Prepare necessary Templates (like order confirmation, appointment reminders)
  • Train Bot to complete conversations within 24 hours

Illustration: WhatsApp 24-Hour Rule Explanation

Scene Description: A timeline chart explaining WhatsApp conversation window rules. Starting from "User sends message," marking the "free reply zone" within 24 hours, and the zone after 24 hours requiring "use Template." The chart clearly indicates time boundaries and corresponding rules.

Visual Focus:

  • Main content clearly presented

Required Elements:

  • Based on key elements in description

Chinese Text to Display: None

Color Tone: Professional, clear

Elements to Avoid: Abstract graphics, gears, glowing effects

Slug: whatsapp-24-hour-window-rule


WhatsApp Business API application too complex? Review process, message templates, conversation window rules... figuring it out yourself could take weeks. Let us help to accelerate the integration process.


Multi-Platform Unified Management Strategy

When operating LINE, Messenger, and WhatsApp simultaneously, effective management is a challenge.

Unified Conversation Logic

Good Practice: One Dialogflow Agent, multi-platform deployment

                    ┌─────────────┐
                    │  Dialogflow │
                    │    Agent    │
                    └──────┬──────┘
                           │
        ┌──────────────────┼──────────────────┐
        │                  │                  │
        ▼                  ▼                  ▼
   ┌─────────┐       ┌───────────┐       ┌──────────┐
   │   LINE  │       │ Messenger │       │ WhatsApp │
   └─────────┘       └───────────┘       └──────────┘

Advantages:

  • Only maintain one copy of conversation logic
  • New features launch on all platforms simultaneously
  • Training data centrally managed

Platform-Specific Responses

Although conversation logic is unified, different platforms have different message formats.

Handling Method: Determine message source in Fulfillment

function handleResponse(agent) {
  const source = agent.originalRequest.source;

  if (source === 'line') {
    // LINE-specific format (Flex Message)
    return lineFlexMessage();
  } else if (source === 'facebook') {
    // Messenger format (Generic Template)
    return messengerTemplate();
  } else {
    // Generic plain text
    return textResponse();
  }
}

For more Fulfillment development details, refer to Dialogflow Fulfillment and API Integration Tutorial.

Data Integration

Different platforms have different user data formats—recommend storing uniformly in your own database.

Recommended Approach:

PlatformUser ID FormatUnified Handling
LINEString starting with UAdd prefix line_
MessengerPSID (numeric)Add prefix fb_
WhatsAppPhone numberAdd prefix wa_

This allows unified customer data management in your own system, cross-platform identification of the same customer.


Best Practices

Conversation Design Principles

1. Keep It Concise

Messaging app conversations should be like real human chat—don't write lengthy paragraphs.

  • Each message no more than 3 lines
  • Use segmented sending
  • Put important information first

2. Provide Options

Use buttons to reduce user typing burden.

Please select service type:
[Book] [Check Order] [Contact Support]

3. Handle Exceptions

Always have a Fallback plan.

Sorry, I don't quite understand what you mean.
You can try:
- Type "book" to make a reservation
- Type "support" to transfer to a human

Platform Characteristic Differences

FeatureLINEMessengerWhatsApp
Rich MenuYesNoNo
Quick ReplyYesYesYes
Card MessagesFlex MessageGeneric TemplateNot Supported
Persistent MenuYesPersistent MenuNo
Proactive BroadcastsLimitedMany RestrictionsTemplate Only

Compliance Considerations

Privacy:

  • All platforms require providing privacy policy links
  • Clearly inform users how data is used
  • GDPR regions require special consent mechanism handling

Content Standards:

  • Cannot send spam messages
  • Cannot send fraudulent or misleading content
  • Cannot send adult or illegal content

Brand Standards:

  • Each platform has Bot naming regulations
  • Cannot impersonate official entities or others
  • Logo and name need to be consistent

Illustration: Multi-Platform Bot Management Dashboard

Scene Description: A management backend mockup showing unified conversation management interface. Left side is platform menu (LINE, Messenger, WhatsApp), center is conversation list, right side is conversation details. Screen shows cross-platform messages unified presentation, convenient for customer service staff management.

Visual Focus:

  • Main content clearly presented

Required Elements:

  • Based on key elements in description

Chinese Text to Display: None

Color Tone: Professional, clear

Elements to Avoid: Abstract graphics, gears, glowing effects

Slug: multi-platform-bot-dashboard


FAQ

What If Messenger Review Keeps Failing?

Common rejection reasons:

  1. Purpose description unclear → Rewrite, clearly explain Bot functionality
  2. Missing privacy policy → Add a qualified privacy policy page
  3. Video demonstration incomplete → Re-record, show main conversation flow

Recommendation: Seek help in Meta developer community, or reference cases that passed review.

How Is WhatsApp Business API Charged?

WhatsApp charges by "conversation," not message count.

Conversation TypeCost (Taiwan Region)
User-Initiated (Customer Service)~$0.02 USD
Business-Initiated (Marketing)~$0.04 USD

Costs vary by region, refer to official announcements

Can Payment Functions Be Embedded in Bot?

  • Messenger: Supports Facebook Pay (some regions)
  • WhatsApp: Supports WhatsApp Pay (some regions)
  • Practical Approach: Most businesses choose to send payment links, directing to their website or third-party payment gateway

How to Handle Human Agent Handoff?

Recommended approach:

  1. Bot detects issue it can't handle
  2. Sends message: "I'm transferring you to a human agent, please wait"
  3. Sends notification to customer service staff in backend system
  4. Customer service staff takes over conversation

Technical Implementation: Requires integrating internal customer service system or Live Chat tool in Fulfillment.


Next Steps

After Messenger and WhatsApp integration is complete, you can:

  1. Integrate LINE to Serve Taiwan Customers: Dialogflow LINE Bot Integration Tutorial
  2. Develop Backend Logic: Dialogflow Fulfillment and API Integration Tutorial
  3. Calculate Costs Precisely: Dialogflow Pricing Complete Analysis
  4. Confirm Version Choice: Dialogflow CX vs ES Complete Comparison

Want to Build Cross-Platform AI Customer Service?

Serving international customers requires Messenger, WhatsApp; serving local customers may require LINE. Managing these platforms with one system maximizes efficiency.

If you need:

  • LINE + Messenger + WhatsApp full platform integration
  • Unified conversation management dashboard
  • Seamless human agent handoff
  • Cross-platform user data integration

Book AI implementation consultation to have us help plan a complete cross-platform AI customer service solution.

Consultation is completely free, we'll respond within 24 hours.


Need Professional Cloud Advice?

Whether you're evaluating cloud platforms, optimizing existing architecture, or looking for cost-saving solutions, we can help

Book Free Consultation

Related Articles