Configuring Facebook Messaging

When you integrate Facebook Messenger with CxEngage, you can read or respond to messages sent to your company's Facebook page or messaging app directly from the Agent Toolbar.

There are a number of steps that you need to complete to enable the interactions between your Facebook page and CxEngage tenant. Detailed instructions to complete each step are included below.

  1. Create and configure your Facebook page.
  2. Add a listener to your CxEngage Facebook integration
  3. Create and publish a flow for Facebook messages sent to your page.
  4. Create a Dispatch Mapping to point incoming Facebook messages to the correct flow.
  5. Submit your messaging app for review

Creating and Configuring your Facebook Page for CxEngage

To create and configure your Facebook page: 

  1. If you don't already have a Facebook page for your business, create one by accessing Facebook and selecting Create Page under the actions menu.
  2. Go to Settings > Page Roles to add any users to your page who may receive or send messages from the page. This access requires either the Moderator, Editor, or Admin page role.

    Only users that have been invited to your page with the appropriate role are able to handle messages.

  3. Go to and select Add New App under the My Apps menu.
  4. Complete the Create New App ID screen by entering a display name and email address.
  5. Click + Add product on the developer's side panel.
  6. Select Messenger and click Get Started, completing sections as needed.
  7. Set up Webhooks with the following details: 
    • Callback URL: Enter this URL, where <tenant-id> is the unique identifier for your tenant.<tenant-id>/
    • Verify Token: This is a mandatory field that can accept any free form text, used to associate any verification code that may be included at your webhook URL entered in the previous field
    • Subscription Fields: Select the following: message_deliveries, messages, messaging_optins, messaging_postbacks
    • Click Verify and Save
  8. In the Token Generation section, select your page from the Page drop down.
  9. In the prompt that appears, grant permissions to the app that you are creating for your page.
  10. Copy the Page Access Token that appears and keep it somewhere as you will need this to configure your CxEngage settings later.
  11. In the Webhooks section, subscribe your page to the assigned webhooks by selecting the page name from the Select a Page drop down.

    If you change the webhook in the future- for example, updating your tenant ID - you must unsubscribe and resubscribe the page.

  12. Click Settings on the developer's side panel.
  13. Complete the basic settings as needed, including an icon for your messaging app and a URL to the privacy policy that your page should be associated with. Optionally, select a page category.

You're now ready to configure your CxEngage tenant with a listener for Facebook messaging events.

Creating a Listener for your Facebook Integration

Your tenant is configured with an integration for the Facebook channel. You need to update that integration to have a listener for events from your Facebook page to the integration.

To add a listener to your CxEngage Facebook integration:  

  1. Go to Configuration > Integrations.
  2. Click on the facebook integration to access the integration details side panel.
  3. Click on the + symbol next to listeners and complete the required fields: 
    • Name: Enter a name for this listener
    • Active: Click the toggle to activate this listener
    • Page Id: Enter your Facebook page ID
      • For pages that are managed in Facebook Business Manager, the Page ID can be found by navigating to the Page in Business Manager > About > More Info and Page ID.
      • For all other pages, navigate to the Page that you are an Admin on > About > More Info and Page ID.
    • Page Token: Enter the Facebook page token that you copied earlier, from Step 10 of your Facebook page configuration.
  4. Click Create.

You're ready to create a flow that is configured to receive and route messaging work offers.

Creating a Messaging Flow

Your tenant needs to have a basic customer flow published and enabled that routes to a queue and is configured for message work offers. You can accomplish this by using one of the following flow design examples.

Now that you have a flow for your messages, you're ready to create a dispatch mapping to tell your tenant to use this flow for Facebook message events.

Creating a Dispatch Mapping for Facebook Messenger

Create a dispatch mapping to tell your tenant what flow an incoming Facebook message should go through.

To create the dispatch mapping: 

  1. Go to Flows > Dispatch Mappings.
  2. Click Create to access the dispatch mapping details side panel.
  3. Enter a Name for this dispatch mapping.
  4. Optionally, enter a brief description for this dispatch mapping.
  5. Select Messaging from the Interaction Type list.
  6. Select Contact Point from the Mapping list.
  7. Enter the Facebook Page ID in the Mapping Value field. You can get this by accessing your Facebook page and looking at the URL. The page ID is located after <your page name->. In this example, the page ID is 1234123412341234.
    Facebook Page ID
  8. Select your messaging flow from the Dispatch to flow list.

Submitting Your Messaging App for Review

Before submitting your messaging app for review, ensure that you are able to receive and reply to messages in Skylight or the Agent Toolbar that are sent from your Facebook developer user. This step validates that the Facebook integration was set up successfully.

During the app review process, Facebook may send you a message that requires you to reply within a specified time frame; therefore, it is important to ensure that you can receive messages.

The final configuration step is to submit the messaging app created in step 7 of Creating and Configuring your Facebook Page for CxEngage for review. Refer to the App Review instructions in the Facebook developer documentation for detailed steps. At minimum, ensure that you select the pages_messaging permission. Review the rest of the permissions to determine if there are others relevant to your app.

Once your app is approved, you are ready to receive and respond to Facebook messages from customers with CxEngage.

Serenova Logo