Configure an SMS channel for Twilio

Omnichannel for Customer Service offers a suite of capabilities that extend the power of Dynamics 365 Customer Service Enterprise to enable organizations to instantly connect and engage with their customers across digital messaging channels. An additional license is required to access Omnichannel for Customer Service. For more information, see the Dynamics 365 Customer Service pricing overview and Dynamics 365 Customer Service pricing plan pages.

The SMS channel through Twilio in Omnichannel for Customer Service allows your organization to connect to customers by using text messages. Your customers can send text messages through Twilio and connect with an appropriate customer service agent. Agents can view incoming SMS requests on their dashboard and respond accordingly.

Prerequisites

Make sure that the following prerequisites are met:

Get Twilio account details

An SMS channel is enabled within Omnichannel for Customer Service by integrating with Twilio. This integration uses public APIs of Twilio for sending and receiving text messages.

  1. In your Twilio account, note the ACCOUNT SID and AUTH TOKEN values. These values are required to create the SMS configuration in the Customer Service admin center app.

  2. Purchase support phone numbers through your Twilio account.

Note

  • US phone numbers only are supported.
  • To ensure that third-party SMS providers handle opt-out commands properly, you must configure your consent settings with the provider directly.

Set up the SMS channel for Twilio

To configure the SMS channel, complete the following tasks:

  • Configure the SMS number
  • Configure the workstream for the SMS channel

Configure the SMS number

  1. In the site map of Customer Service admin center, in Customer support, select Channels.

  2. In Accounts, for Messaging accounts, select Manage.

  3. On the Accounts and channels page, select New account.

  4. Enter the following details:

    1. In Channel details, enter a name, and select SMS in Channel.
    2. In Account details, select Twilio in Provider, and then enter the following details:
      • Account SID: Enter the Twilio ACCOUNT SID.
      • Auth token: Enter the Twilio AUTH TOKEN.
    3. In SMS phone numbers, select Add, and enter the following details in Add SMS number:
      • Number: Specify the support phone number that you purchased from Twilio in the <country_code><phone_number> format, such as 14252306549. Make sure that you don't enter blank spaces or special characters.
      • Type: Select Long code, Short code, or Toll free.
      • Description: Specify a description for the number. (Optional)
    4. In Callback information, copy the callback information. The copied information is used for the Twilio account.
    5. Select Done. The account is configured.

Configure the workstream for the SMS channel

To configure the workstream, make sure you perform the steps to create a workstream for the SMS channel. More information: Create workstreams

  1. Go to workstreams page and open the workstream you created for the channel.
  2. In the Set up your SMS channel section, select Set up SMS, and then configure the following options:
    1. On the SMS setup page, select a number from the list.
    2. On the Language page, select the language that you want to set as the default.
    3. On the Behaviors page, configure the following options:
    1. In User features, set the toggle for File attachments to On and select the following options if you want both agents and customers to exchange files. More information: Enable file attachments
    • Customers can send file attachments
    • Agents can send file attachments
    1. Verify the settings on the Summary page, and then select Finish. The SMS for Twilio channel is configured.
  3. Configure routing rules. More information: Configure work classification
  4. Configure work distribution. More information: Work distribution settings
  5. Add a bot. More information: Configure a bot
  6. In Advanced settings, configure the following options based on your business needs:

Establish a connection between Omnichannel for Customer Service and the Twilio account

Perform the following steps to configure the URL in Twilio for the SMS messages from Omnichannel for Customer Service to be processed in Twilio:

  1. Copy the value in Twilio inbound URL of the workstream for Twilio.

  2. Go to your Twilio account > Phone Numbers > Active Numbers, and then select the SMS phone number.

  3. In the Messaging section, paste the Twilio inbound URL.

Flow of data between Omnichannel for Customer Service - SMS channel and Twilio

Incoming text messages

For an incoming text message sent by a customer to the support phone number, the message is first sent to the Twilio messaging service. Then Twilio pushes it to Omnichannel for Customer Service by using the callback URL. The message is then routed and associated to either a new or an existing conversation by Omnichannel for Customer Service.

Outgoing text messages

For an outgoing message sent by an agent from within Dynamics 365, the message is first sent to the Twilio service and then Twilio sends it to the customer. In addition to the text message, Omnichannel for Customer Service uses the APIs provided by Twilio to send the customer's phone number, support phone number, and the Twilio account information (Account SID and the Auth Token) to the Twilio service.

Twilio account and phone number validation

When you validate the SMS settings while setting up the SMS channel, a call is made to Twilio to validate the Account SID and Auth Token.

See also

Channels in Omnichannel for Customer Service
Overview of SMS channels
Delete a configured channel
Configure SMS channel using Azure Communication Services Configure SMS channel using TeleSign SMS FAQ