This guide will walk you through setting up Facebook Messenger integration with your ChatLab bot. The integration allows your bot to send and receive messages through Facebook Messenger Platform.
Prerequisites
Before starting, ensure you have:
- A Facebook Developer account
- A Facebook Business Page
- A Meta App in Facebook for Developers
- Admin access to your Facebook Page
- A verified Facebook Page
Step-by-Step Setup Process
1. Create a Meta App
- Go to Meta for Developers
- Click "My Apps" → "Create App"
- Select "Business" as the app type
- Fill in your app details:
- App Name
- App Contact Email
- Business Account (optional)
- Click "Create App"
2. Add Messenger Product to Your App
- In your app dashboard, click "Add Product"
- Find "Messenger" and click "Set Up"
- Follow the setup wizard to configure Messenger Platform
3. Generate Page Access Token
- In the Messenger settings, scroll to "Access Tokens" section
- Click "Add or Remove Pages"
- Select the Facebook Page you want to connect
- Grant required permissions:
pages_messaging
pages_show_list
- Copy the Page Access Token that appears
- Important: Store this token securely - you'll need it for ChatLab
4. Get Required Information
You'll need to collect the following information for ChatLab:
Page Access Token
- The token you generated in Step 3
- This authenticates your application with Messenger Platform
App Secret
- In your Meta app dashboard, go to "Settings" → "Basic"
- Find your App Secret (click "Show" to reveal it)
- Copy this value - it's used for webhook verification
Page ID
- Go to your Facebook Page
- Click "About" in the left sidebar
- Scroll down to find your Page ID
- Alternative: In your app's Messenger settings, the Page ID is shown next to your page name
Webhook Verify Token
- Create a custom secure token (e.g., a random string)
- This token will be used to verify webhook requests
- Keep this secure - you'll enter it in both ChatLab and Meta
5. Configure Webhooks
- In your Meta app dashboard, go to Messenger → "Settings"
- In the Webhooks section, click "Add Callback URL"
- Enter your webhook details:
- Callback URL:
https://your-chatlab-webhook-url
(provided by ChatLab support) - Verify Token: The custom token you created in Step 4
- Subscribe to these webhook events:
messages
messaging_postbacks
messaging_optins
message_deliveries
message_reads
- Click "Verify and Save"
6. Subscribe App to Page
- In the Webhooks section, find your subscribed page
- Click "Subscribe" next to your Facebook Page
- Ensure the subscription is active
7. Configure ChatLab Integration
Once you have all the required parameters from Meta, follow these steps to configure the integration in ChatLab:
Accessing Messenger Integration Settings
- Log into ChatLab Admin Panel
- Go to your ChatLab admin dashboard
- Sign in with your account credentials
- Navigate to Bot Settings
- Select the bot you want to integrate with Messenger
- Go to "Settings" → "Integrations"
- Click on "Messenger Functions"
Messenger Integration Form Fields
Enable Facebook Messenger Integration
- Toggle the "Enable Facebook Messenger integration" switch
- This activates the Messenger functionality for your bot
Required Parameters:
- Page Access Token 🔐
- Field Label: "Page Access Token"
- Description: Facebook Page access token from Meta for Developers
- Where to get it: Generated in Meta App Dashboard → Messenger → Access Tokens
- Format: Long alphanumeric string (e.g.,
EAAB1234...
) - Security: This field is password-protected with a reveal option (eye icon)
- Validation: Required when Messenger integration is enabled
- App Secret 🔑
- Field Label: "App Secret"
- Description: Your Meta app's secret key used for webhook verification
- Where to get it: Meta App Dashboard → Settings → Basic
- Format: Alphanumeric string (e.g.,
abc123def456...
) - Security: This field is password-protected with a reveal option (eye icon)
- Validation: Required when Messenger integration is enabled
- Page ID 📱
- Webhook Verify Token 🔐
Step-by-Step Configuration Process
- Enable the Integration
- Fill in Page Access Token
- Enter App Secret
- Add Page ID
- Set Webhook Verify Token
- Save Configuration