Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Manage Conversations Addresses for Facebook Messenger (Public Beta)


(warning)

Warning

Public Beta
Facebook Messenger for Flex is currently available as a Public Beta product and the information contained in this document is subject to change. This means that some features are not yet implemented and others may be changed before the product is declared as Generally Available. Public Beta products are not covered by a Twilio SLA.

(information)

Info

Not a HIPAA Eligible Service
Facebook Messenger for Flex is not a HIPAA Eligible Service and cannot be used in Flex workflows that are subject to HIPAA.


Overview

overview page anchor

This guide describes how to set up Facebook Messenger as a Flex Conversations channel. Once configured, agents in Flex can receive and reply to messages that come from Facebook Pages. Customers must message agents first, as agent-initiated outbound messages are not supported. For more details, see Facebook's messaging policy(link takes you to an external page). Messages can include text, images, and file attachments.

Some benefits of using Facebook Messenger with Flex include:

  • Customers who find your business through Facebook can contact you right away.
  • Supervisors can see live and historic data in the Flex dashboard and reports.
  • Admins can configure Studio flow responses so customers instantly receive auto-replies.

Limitations

limitations page anchor

For limitations, see File Attachments and API Limits and Known Issues.


Connect Facebook Messenger to Flex

connect-facebook-messenger-to-flex page anchor

Step 1: Connect your Facebook Page in the Twilio Console

step-1-connect-your-facebook-page-in-the-twilio-console page anchor
  1. In the Twilio Console(link takes you to an external page) , from the Develop sidebar, click Explore Products .
  2. Under Marketplace , click Channels . Tip : To pin Channels to the sidebar for access later, click the pin icon.
  3. In the sidebar, click Facebook Messenger .
  4. Click Enable Facebook Messenger .
  5. Click Log in with Facebook .
  6. A Facebook login page appears. Log in to Facebook, and select the Facebook Page that you want Twilio to access.
  7. In the Create your first sender window, select the Page you'd like to connect. A Sender is the address used when you communicate with customers. Note : A Facebook page can be linked to only one Twilio Account.
  8. Review the terms of service, and select the checkbox to acknowledge and agree to them.
  9. Click Submit .

For more detailed information on setup and functionality, see Facebook Messenger Setup.

Step 2: Create a Conversations address for your Facebook Page

step-2-create-a-conversations-address-for-your-facebook-page page anchor

To receive and reply to messages in Flex, create a Conversations address through the Console or using the API.

Console

console page anchor
  1. In the sidebar, select Flex > Manage > Messaging .
  2. Click Create New Address .
  3. From the Address Type list, select Facebook Messenger.

    Facebook_Messenger_Create_Address.
  4. From the Facebook page list, select the page you connected.
  5. From the Integration type list, select how you'd like conversations to pass to Flex, via Studio or Webhook .
    - If you selected Studio , from the Studio Flow list, you can select the out-of-box Messaging Flow , unless you have removed or changed your studio flow. If you've changed your studio flow, make sure the Incoming Conversations trigger connects to the Send to Flex widget.
    - To learn more about configuring Studio Flows, see Configure pre-agent workflow with Studio .
  6. Click Create Address .

You can programmatically create and manage a Messenger address using the Conversations API's Address Configuration Resource. The example below includes a retry count:

Create a Facebook Messenger Address via the API

create-a-facebook-messenger-address-via-the-api page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
// Find your Account SID and Auth Token at twilio.com/console
_17
// and set the environment variables. See http://twil.io/secure
_17
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17
const authToken = process.env.TWILIO_AUTH_TOKEN;
_17
const client = require('twilio')(accountSid, authToken);
_17
_17
client.conversations.v1.addressConfigurations
_17
.create({
_17
'autoCreation.enabled': true,
_17
'autoCreation.type': 'studio',
_17
'autoCreation.studioFlowSid': 'FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_17
'autoCreation.studioRetryCount': 3,
_17
type: 'messenger',
_17
address: 'messenger:<facebook_page_id>'
_17
})
_17
.then(address_configuration => console.log(address_configuration.sid));

Output

_22
{
_22
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_22
"sid": "IGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_22
"address": "messenger:<facebook_page_id>",
_22
"type": "messenger",
_22
"friendly_name": "My Test Configuration",
_22
"address_country": "CA",
_22
"auto_creation": {
_22
"enabled": true,
_22
"type": "webhook",
_22
"conversation_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_22
"webhook_url": "https://example.com",
_22
"webhook_method": "POST",
_22
"webhook_filters": [
_22
"onParticipantAdded",
_22
"onMessageAdded"
_22
]
_22
},
_22
"date_created": "2016-03-24T21:05:50Z",
_22
"date_updated": "2016-03-24T21:05:50Z",
_22
"url": "https://conversations.twilio.com/v1/Configuration/Addresses/IGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_22
}

Step 3: Send and receive your first Facebook Messenger message in the Flex UI

step-3-send-and-receive-your-first-facebook-messenger-message-in-the-flex-ui page anchor
  1. Open the Flex UI and log in as an agent.
  2. Set your status to Available .
  3. From a different Facebook profile, send a message to the Facebook Page(link takes you to an external page) that you connected to Flex.
  4. In the Flex UI, accept the Incoming messenger request and type a reply. The reply appears in Facebook Messenger.
Facebook_Messenger_Flex_UI.

Rate this page: