Configure an SMS channel for Twilio
Applies to: Dynamics 365 Contact Center—embedded, Dynamics 365 Contact Center—standalone, and Dynamics 365 Customer Service
The SMS channel through Twilio 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:
SMS for Twilio is provisioned in the Customer Service admin center or Contact Center admin center application. More information: Provision channels
A Twilio account with a phone number and subscription is available.
Note
For new Twilio accounts, you must disable a security setting that blocks media files. More information: Extended notice and update on security changes: HTTP Authentication for Voice and Messaging Media enabled by default
Permissions on the secure columns. More information: Configure permissions to access secure columns
Get Twilio account details
An SMS channel is enabled within the application that's integrated with Twilio. This integration uses public APIs of Twilio to send and receive text messages.
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.
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
In the site map of Contact Center admin center or Customer Service admin center, go to Customer support, and then select Channels.
In Accounts, for Messaging accounts, select Manage.
On the Accounts and channels page, select New account.
Enter the following details:
- In Channel details, enter a name, and select SMS in Channel.
- 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.
- 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)
- In Callback information, copy the callback information. The copied information is used for the Twilio account.
- 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
- Go to workstreams page and open the workstream you created for the channel.
- In the Set up your SMS channel section, select Set up SMS, and then configure the following options:
- On the SMS setup page, select a number from the list.
- On the Language page, select the language that you want to set as the default.
- On the Behaviors page, configure the following options:
- Channel operation hours: Set the toggle to On, and then select an operating hour record. More information: Configure operating hours
- Custom automated messages
- Post-conversation survey
- 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
- Verify the settings on the Summary page, and then select Finish. The SMS for Twilio channel is configured.
- Configure routing rules. More information: Configure work classification
- Configure work distribution. More information: Work distribution settings
- Add a bot. More information: Configure a bot
- In Advanced settings, configure the following options based on your business needs:
Establish a connection between omnichannel application and Twilio
Perform the following steps to configure the URL in Twilio for the SMS messages from the omnichannel application to be processed in Twilio:
Copy the value in Twilio inbound URL of the workstream for Twilio.
Go to your Twilio account > Phone Numbers > Active Numbers, and then select the SMS phone number.
In the Messaging section, paste the Twilio inbound URL.
Flow of data between omnichannel application 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 application by using the callback URL. The message is then routed and associated to either a new or an existing conversation by the application.
Outgoing text messages
For an outgoing message sent by an agent from within the application, the message is first sent to the Twilio service and then Twilio sends it to the customer. In addition to the text message, the application 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.
Related information
Overview of channels
Overview of SMS channels
Delete a configured channel
Configure SMS channel using Azure Communication Services
SMS FAQ