Skip to main content

Messenger Integration

๐Ÿ”น Before App Installation

Pre-Installation Checklistโ€‹

Complete these steps before proceeding with the installation.

๐Ÿ’ฌ Messenger Integrationโ€‹

โ„น๏ธ Note: Leave these fields blank if you don't want to use Messenger now. You can configure it later.

Option 1: Set Up Laterโ€‹

Run this command on your server when ready:

MESSENGER_APP_ID='your_messenger_app_id' \
MESSENGER_APP_SECRET='your_messenger_app_secret' \
MESSENGER_CONFIGURATION_ID='your_messenger_config_id' \
MESSENGER_VERIFY_TOKEN='your_messenger_verify_token'

Option 2: Set Up Nowโ€‹

Follow the configuration instructions below.

๐Ÿ›  Step 1: Locate Configuration Fileโ€‹

  1. Open the web-server.env file in the installation folder provided by WhautoChat.
  2. Update the following Messenger integration settings:
# Messenger Integration
MESSENGER_APP_ID="your_messenger_app_id"
MESSENGER_APP_SECRET="your_messenger_app_secret"
MESSENGER_CONFIGURATION_ID="your_messenger_configuration_id"
MESSENGER_VERIFY_TOKEN="your_messenger_verify_token" # Any random string

Messenger Integration

๐Ÿงฉ Step 2: Create a Meta Business Portfolioโ€‹

โฉ Skip this step if you already have a Meta Business Suite account.

  1. Go to business.facebook.com
  2. Log in with your Facebook account
  3. Create a Meta Business Suite account to generate your business portfolio

๐Ÿ‘จโ€๐Ÿ’ป Step 3: Create a Facebook Developer Appโ€‹

โฉ Already have a Meta App for WhatsApp or Messenger? Skip to Step 4.

  1. Go to Facebook Developers
  2. Log in or sign up for a Developer account
  3. Click "My Apps" in the top-right corner, then "Create App"

My Apps

  1. In the dialog, click the Create App button (top right)

Create Meta App

  1. Enter the app details:
    • App Name (e.g., "ABC Business")
    • App Contact Email
    • Click Next

App Details

  1. Under "Use Cases", select Other โ†’ Click Next

Use Cases

  1. Choose Business as the App Type โ†’ Click Next

App Type

  1. Select your Meta Business Account โ†’ Click Create App

Create App

๐Ÿ”‘ Step 4: Get App ID & App Secretโ€‹

  1. In the left sidebar, go to Settings > Basic
  2. Update required info (App domain, Privacy Policy, etc.)
  3. Click Save Changes
  4. Copy these values:
    • App ID โ†’ Paste into MESSENGER_APP_ID
    • App Secret โ†’ Paste into MESSENGER_APP_SECRET

Get App ID & Secret

โš™๏ธ Step 5: Get Messenger Configuration IDโ€‹

  1. Go to the Dashboard
  2. Scroll to "Facebook Login for Business" โ†’ Click Set Up

Facebook Login

  1. Under Settings, enable Login with the JavaScript SDK
  2. Add your self-hosted app domain (e.g., https://yourappdomain.com/)
  3. Click Save

JavaScript SDK

  1. Go to Configuration โ†’ Click Create Configuration

Create Configuration

  1. Name it (e.g., "Messenger") โ†’ Click Next

Messenger Configure

  1. Choose General login variation โ†’ Click Next

General Login Variation

  1. Select User Access Token โ†’ Click Next

User Access Token

  1. Enable these permissions:
    • pages_messaging
    • pages_show_list
    • pages_manage_metadata
    • business_management
  2. Click Create

Messenger Permissions

  1. Copy the generated Configuration ID โ†’ Paste into MESSENGER_CONFIGURATION_ID

Configuration ID

๐Ÿงช Step 6: Set Messenger Verify Tokenโ€‹

  1. Generate a random string using random.org/strings

Random String

  1. Copy any of one generated string
  2. Update in your configuration:
    MESSENGER_VERIFY_TOKEN="your_random_string_here"
    Example: MESSENGER_VERIFY_TOKEN="2AqYO0vP0M"

โœ… Final Configurationโ€‹

Your complete .env configuration should look like this:

# Messenger Integration
MESSENGER_APP_ID="112233445566778"
MESSENGER_APP_SECRET="a1b2c3d4e5f6g7h8i9j0"
MESSENGER_CONFIGURATION_ID="9988776655443322"
MESSENGER_VERIFY_TOKEN="2AqYO0vP0M"

โš ๏ธ Important: Messenger setup is required if you plan to let your clients use Messenger in their communication channels. Without this, Messenger will not be available.


๐Ÿ”น After App Installation

Post-Installation Configurationโ€‹

๐Ÿ’ฌ Messenger Webhook Configuration (Self-Hosted Setup)โ€‹

โš ๏ธ Important: Webhook configuration is mandatory after installation. Without it, Messenger messaging will not work.

๐Ÿ”ง Step-by-Step Instructionsโ€‹

โœ… 1. Open Your Meta Appโ€‹

  1. Go to developers.facebook.com
  2. Log in with your Meta developer account
  3. Click My Apps (top-right) and select your app

Open Your Meta App

โš™๏ธ 2. Set Up Messengerโ€‹

  1. In the Dashboard, scroll to the Messenger section
  2. Click Set Up

Setup Messenger

๐ŸŒ 3. Configure Webhooksโ€‹

In the Messenger API Settings:

  1. Callback URL:

    https://yourserverdomain.com/messenger/webhook
  2. Verify Token: Use the same value from your .env file (MESSENGER_VERIFY_TOKEN)

    Example: 2AqYO0vP0M

  3. Click Verify and Save

Configure Webhooks

๐Ÿ”” 4. Subscribe to Webhook Fieldsโ€‹

In the Webhook Fields section, enable Subscribed for:

  • messages
  • message_reads
  • messaging_postbacks
  • messaging_optins
  • messaging_referrals

Webhook Fields

โœ… 5. Finalize in WhautoChatโ€‹

  1. Go to your self-hosted app panel
  2. Complete Messenger Integration
  3. Send a test message to verify everything works

๐Ÿ’ก Summary of Required Valuesโ€‹

MESSENGER_VERIFY_TOKEN="2AqYO0vP0M" MESSENGER_WEBHOOK_URL="https://yourserverdomain.com/messenger/webhook"

Need Help?โ€‹

๐Ÿ“ฉ Contact us at support@whauto.chat โ€“ we're happy to help!

Additional Resourcesโ€‹


For advanced features or troubleshooting, refer to Facebook's documentation or WhautoChat support.