Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developer.watson-orchestrate.ibm.com/llms.txt

Use this file to discover all available pages before exploring further.

Deploy your agent to Facebook Messenger using the Facebook Channel integration.

Prerequisites

  • A Facebook account with access to the following resources:
    • A Facebook Page
    • A Facebook App that is connected to that Page
  • Facebook Developer credentials:
    • Facebook App Secret
    • Facebook Page Access Token
  • A user-defined verification token for webhook validation

Create a Facebook Messenger channel

Use one of the following methods to define the channel. Using YAML:
# Facebook Messenger Channel Configuration Example

spec_version: v1
kind: channel

# Required: Channel type identifier
channel: facebook

# Required: Name for this channel instance
name: production_facebook_channel

# Optional: Description of this channel
description: Main customer support Facebook Messenger channel for production environment

# Required: Facebook app secret
application_secret: ${FACEBOOK_APP_SECRET}

# Required: Page access token for the Facebook page
page_access_token: ${FACEBOOK_PAGE_ACCESS_TOKEN}

# Required: Verification token for webhook verification. This value can be any string value that you create.
# You must enter the same string when you complete the Webhooks configuration on the Facebook side.
verification_token: ${FACEBOOK_VERIFICATION_TOKEN}
Using Python:
import os
from ibm_watsonx_orchestrate.agent_builder.channels import FacebookChannel
from dotenv import load_dotenv
load_dotenv()

# Define the Facebook Messenger channel configuration
channel = FacebookChannel(
    name="production_facebook_channel",
    description="Main customer support Facebook Messenger channel for production environment",
    application_secret=os.getenv("FACEBOOK_APP_SECRET"),
    verification_token=os.getenv("FACEBOOK_VERIFICATION_TOKEN"),
    page_access_token=os.getenv("FACEBOOK_PAGE_ACCESS_TOKEN")
)

Configuration requirements

FieldRequiredFormatDescription
application_secretYesStringFacebook App Secret from the app’s Basic settings
page_access_tokenYesStringPage Access Token for the connected Facebook Page
verification_tokenYesStringUser-defined token used to verify Facebook webhook ownership