Skip to main content

Facebook Messenger Integration

Integrating Messenger with FahemAI allows your custom agent to communicate directly with customers via your Facebook pages. It also allows you to takeover the conversation whenever you want and communicate with users yourself through Messenger. This guide will walk you through the necessary steps to connect your agent to Messenger for your Facebook pages, ensuring smooth and effective customer interactions.

Meta Developer Portal Setup

Before connecting to FahemAI, you need to set up an app on the Meta for Developers portal.

Create a Meta App

  1. Go to Meta for Developers and create a new App.
  2. Select Other as the use case and choose Business or Consumer.
  3. Give your app a name and click Create App.

Add Messenger Product

  1. In your App Dashboard, find Messenger and click Set Up.
  2. Navigate to Messenger > Settings.
  3. Under Access Tokens, add your Facebook Page and generate a Page Access Token.

Get App Credentials

  1. Go to App Settings > Basic.
  2. Securely copy your App ID and App Secret. You will need these for the next steps.

Connecting in FahemAI

Once you have your Meta credentials, follow these steps to link your bot:

Select Facebook Adapter

  1. Go to your FahemAI dashboard and select the bot you want to connect.
  2. Navigate to the Bots section in the sidebar.
  3. Click the + (Plus) button and select Facebook from the dropdown menu.
Select Facebook Adapter

Configure App Credentials

Enter your Facebook App credentials obtained from the Meta portal:

  1. Paste your App ID.
  2. Paste your App Secret.
  3. Enter your Page ID.
Configure Facebook App Credentials

Set Graph API and Tokens

  1. Provide your Page Access Token.
  2. Set a Verify Token (this can be any secret string, e.g., fahemai_verify).
  3. Choose the latest Graph API Version.
Set Tokens and API Version

Configure Webhook

  1. Set the Webhook Base URL (your server URL).
  2. Define the Webhook Path (usually /adapter/messenger/webhook).
  3. Enable Stream Reply Mode.
Configure Webhook and Submit

Save and Test

  1. Click Submit or Save to activate the integration.
  2. Now, send a message to your Facebook Page to test the AI's responses.
Success

Success! Your bot is now live on Messenger. It will respond immediately to messages sent to your Facebook Page.

Need help?

Need help? For any further questions, please do not hesitate to contact us.