Customer Channel Manager provides out-of-the-box integration with Facebook Messenger.
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 has the following:
- HTTPS support, Self-signed certificates are not supported
- A valid SSL certificate
- An open port that accepts
Once the above pre-reqs are complete, follow these steps.
- Login to your 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.
- Copy Page access token and set it in the variable FACEBOOK_VERIFY_TOKEN in SMS Connector Environment Variables.
- Restart the sms-connector component.
Registering a webhook
Add a callback URL in the Messenger settings with these values,
- Callback URL: https://<fqdn>/sms/webhook?hub.verify_token=<FACEBOOK_VERIFY_TOKEN>&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe
- Verify Token: FACEBOOK_VERIFY_TOKEN
- Subscribe to the messages field in the Messenger settings.
- 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.
Environment Variables for Facebook Integration
Set the following variables in the SMS Connector Environment Variables.
https://graph.facebook.com/v4.0. This is the URL for the Facebook Graph APIs.
Chat display name/ business name shown to the customer during the chat conversation.
The error message shown in case the message from the customer is not processed successfully or if any error occurs.
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.