Skip to main content
Skip table of contents

Facebook

Hybrid Chat supports Facebook Messenger integration for private user-to-user messages. You can link your business Facebook page which allows your contact center agents to exchange FB messages with your customers using FB Messenger. See the Facebook Comment page if you wish to route Facebook Comments to agents.

Hybrid chat supports Facebook buttons, which are displayed as options for the user to choose from. You can create a minimum of two and a maximum of three buttons. Hybrid Chat also supports the Facebook carousel, where you can have as many as 10 carousel elements. Details on how Facebook buttons and carousel can be implemented with Hybrid Chat, see Rich Media Messaging


Facebook Messenger API Updates

From December 16, 2020, onwards, Facebook has made a change to comply with new privacy rules in Europe, Facebook will be making updates that will impact some developers and businesses that use Facebook Messenger API. Examples of some features that will no longer be available via Messenger API include:

Some templates (e.g. Airline, Receipt) and audio/video attachments, Persistent menu, One-Time Notification, and some templates and buttons on the web (e.g. Generic, Button.) There will be no impact on people’s experiences using only text and quick replies, whether automated or live agent-driven.

The following features will continue to be available:

Sending and receiving text messages and images, Get Started button, Ice breakers and quick replies, Generic template, button template, and media template on Android and iOS only.
URL button, postback button, call button on Android and iOS only, Private replies, m.me links, and the Message Us plugin Webview. 
Click here for more details.


Facebook Integration Prerequisites

To deploy a live webhook that can receive webhook events from the Messenger Platform, your code must be hosted on a public HTTPS server that meets the following:

  • Channel Manager should publicly be accessible with a valid (not self-signed) certificate. 
  • Have a Facebook developer account.
  • Follow this documentation to create a Facebook App.
  • Add a product Messenger. 
  • Create or link a Facebook page and generate an access token.
  • Add a product Messenger. 
  • Create or link a Facebook page and generate an access token.
    • Specify this value against FACEBOOK_VERIFY_TOKEN in Channel Manager configurations.
  • Recreate the ccm component.

Registering a webhook

Register Channel Manager webhook in Facebook as a callback URL. Facebook Messenger calls this API every time there's a customer message or related event. Add a callback URL in the Messenger settings with these values:

Callback URLhttps://<fqdn>/ccm/webhook?hub.verify_token=<FACEBOOK_VERIFY_TOKEN>&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe
Verify TokenFACEBOOK_VERIFY_TOKEN

Add subscriptions

Subscribe to at least the following Facebook events. 

messages

Subscribe to the messages field in the Messenger settings.

messaging_postbacksSubscribe to the messaging_postbacks field ,to get postbacks from Facebook page


FB Test Accounts

  1. Add one or more Facebook accounts as "Tester" under the Roles section. Each tester must accept the request by logging in to the Facebook Developer Account.   

Live Facebook App - Additional Prerequisites

Submit a request to Facebook for the Business Asset User Profile Access feature, if your Facebook app is in Live Mode.  Facebook might take some time to approve the request.

  • Move into App Review Section of your Facebook App.
  • Select Permissions and Features from drop down menu.
  • Search for Business Asset User Profile Access and choose Request

Environment Variables for Facebook Integration

Set the following variables in the (3.15 ) Customer Channel Manager (CCM) Environment Variables.

Variable Name

Description

Value

FACEBOOK_GRAPH_API_URL

This is the URL for the Facebook Graph APIs. 

https://graph.facebook.com/v4.0

FACEBOOK_VERIFY_TOKEN


Facebook access token

FACEBOOK_USERNAME

Chat display name/ business name shown to the customer during the chat conversation.

Business Name

ERROR_MESSAGE_RESPONSE

The error message shown in case the message from the customer is not processed successfully or if any error occurs.


FB_ROUTING_POLICY

A directive for Hybrid Chat to decide routing of requests from Facebook account.

DEFAULT

No directive from Channel Manager for the Hybrid Chatbot or chat-server. HybridChat will route requests either to the bot or the agent based on the Bot training and chat-server configurations.

BOT_ONLYChat requests should not be routed to the agent even if the Bot's confidence level for a response is below the confidence threshold.

Communication Flow

The architecture diagram below shows how the flow of communication happens between the different components in the case of Hybrid Chat and Facebook integration. Hybrid chat agent gadget, shown here as the Messenger App communicates directly to our Hybrid Chat server (shown here as the Business Server). It communicates directly with the Facebook server. It receives data through webhooks and sends it through the Facebook business APIs. 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.