Twilio Channels

Public Beta
Twilio Channels are currently available as a Public Beta product. 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.

Channels is the collection of third-party integrations that let you send and receive messages on multiple channels with the Twilio APIs you already use. Using Channels with Twilio makes it easy to reach your customers on new platforms, such as Facebook Messenger, Slack, LINE, Twitter, HipChat, and more.

Channels is available through the Twilio Marketplace; you can choose from a list of verified Channels and install them in a single click. Once installed, they allow you to send and receive messages with other communications platforms using the Twilio API.

Supported Products

Twilio Channels are currently supported by Programmable SMS and Notify. Click here to install specific Channels or request access to Channels in Developer Preview.

Twilio Product Channels in Public Beta Channels in Developer Preview (request access) Channels coming soon
Programmable SMS Facebook Messenger LINE SendGrid, Slack, Twitter, HipChat, Kik, Viber, WeChat, BlackBerry Messenger, Notifications for Alexa
Notify Facebook Messenger SendGrid, WeChat, BlackBerry Messenger, Slack, Twitter, HipChat, LINE, Kik, Viber
Proxy Facebook Messenger, SendGrid, Slack, Twitter, HipChat, LINE, Kik, Viber, WeChat, BlackBerry Messenger

Terms of Service

Channels are provided and supported by Channel providers in the Twilio Marketplace. As a part of the Channel installation process, you will be required to accept the Channel provider’s Terms of Service. Note that the Channel is provided under the Partner’s Terms of Service & Privacy policy. Channel specific documentation can be found inside the Console under the Channel's catalog page.

Setup and Configuring a Channel

Installing a Channel

Getting started with Channels is simple. Available Channels are listed in the Channels Catalog inside the Console. To get started, click on the Channel and install it. This creates an instance of the Channel that you can configure with a Unique Name and enable for use in one or more Twilio products.

Authentication with Channel Provider & Configuration

In order to send and receive messages from a Channel, you must have an account setup within the specified platform. You will then authorize Twilio to send and receive messages on your behalf, thereby enabling access to each platform through the Twilio API.

Once a Channel is enabled, the next step is to authenticate the Channel instance with the Channel provider. This also links the Channel instance to a Channel-specific endpoint (such as a Facebook page) within that Channel. The specifics of this vary from Channel to Channel; please refer to Channel-specific documentation on the Channel detail page inside console.

Once a Channel is authenticated, you can now configure it to work with a Twilio API :

Configuration Parameter Description
Channel address This is a unique identifier for the user facing Channel endpoint such as a Facebook Page. Channel addresses take the form of channel-provider:identifier. For instance, the Channel address for a Facebook Channel is messenger:<page id>. This is not user editable.
Callback URL A URL where Twilio will POST each time a message is received by Twilio. The format of this request is the same as Twilio's Inbound SMS TwiML Request. Non-relative URLs must contain a valid hostname (underscores are not allowed).
Callback Method Method to use with Callback URL. GET or POST.
Fallback URL Fallback URL to which Twilio will POST if the Callback URL above returns an error.
Fallback Method Method to use with Fallback URL. GET or POST.
Status Callback URL A URL where Twilio will POST each time your outbound message status changes to one of the following: failed, sent. Twilio will POST the standard TwiML request parameters as well as standard Status parameters : MessageStatusand ErrorCode.
Non-relative URLs must contain a valid hostname (underscores are not allowed).
Status Callback Method Method to use with Status Callback. GET or POST.

Creating multiple instances of a Channel

Twilio supports creating multiple instances of a Channel so that your application can use different Channel-specific endpoints. For example, this allows you to support sending / receiving messages from multiple Facebook pages, by creating and associating each Facebook page with an instance of the Facebook Channel.

Using the Channel

You use the same Twilio product APIs to send and receive messages from Channels. All you need to do is reference the Channel address you configured when you installed the Channel.

Once the Channel is configured, you need to select the Twilio product you would like to use the Channel with by checking the appropriate product checkbox under "Use In".

Channel Addresses

Each Channel uses a different unique identifier scheme to address users. The table below lists how users are identified by each supported Channel when used with Twilio APIs. For more details on endpoints and addresses for a given Channel, please refer to Channel-specific documentation on the Documentation page linked to from the Channel detail page inside console

Channel Channel endpoint visible to end-user Channel endpoint address Channel user address Notes
Facebook Messenger Facebook Page messenger:{page-id} messenger:{messenger id} or messenger:{e164 formatted phone number} Messenger ID is different from a Facebook ID, and is specific between the Messenger User and your Facebook Page. It can only be retrieved when the Facebook Messenger User sends you a message.
Addressing a Messenger user via phone number requires this feature to be enabled by Facebook for that page.

Programmable SMS

In order to use a Channel with Programmable SMS, you need to check the "Use In: Programmable SMS Inbound" checkbox.

See the REST API: Sending a SMS or MMS or REST API: Messages page for details on how to use Channels via Programmable SMS APIs.

Here's an example of how you can send a message to Facebook Messenger using Programmable SMS:

curl -X "POST" \
--data-urlencode 'To=messenger:{Messenger User ID}' \
--data-urlencode 'From=messenger:{Facebook Page ID}' \
--data-urlencode 'Body=Would you like to play a game?' \
-u {Account Sid}:{Auth Token} \
https://api.twilio.com/2010-04-01/Accounts/{AccountSID}/Messages.json

In order to receive a message from Facebook Messenger using Programmable SMS, set the Callback URL under Configuration section once the Channel has been installed. This URL will receive a callback with the same format as Incoming SMS TwiML Callbacks.

Notify

Coming soon.

Managing Opt Ins, Opt Outs, and Consumer Preferences

Just like you are required to manage consumer opt-ins for your SMS applications, you are also responsible for managing consumer opt-ins to OTT platforms. Users of your application must explicitly grant you permission to message them in each unique channel. For example, consent to send someone a text message does not grant you permission to contact them via Messenger.

Similarly, you should respect consumers who opt-out on each platform. Each platform has their own method of opting out, which Twilio will normalize for you as much as possible. For example, consumers may text STOP to opt out of SMS, or they may block your application to stop messaging within an OTT channel. If a user opts out of one communication channel, you are NOT required to opt them out of all channels. You may treat each opt in and opt out independently.

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.