Configure a WhatsApp channel through Twilio
Applies to: Dynamics 365 Contact Center—embedded, Dynamics 365 Contact Center—standalone, and Dynamics 365 Customer Service
Note
Copilot Studio bot is renamed as Copilot agent (agent or AI agent). Human agent is now renamed as customer service representative (service representative or representative). You might come across references to the old and new terms while we update the product UI, documentation, and training content.
The WhatsApp channel feature lets you integrate WhatsApp through Twilio with either the Customer Service admin center or Contact Center admin center application to engage with customers who prefer to use the WhatsApp channel.
The success of social media customer service, like all other customer service, depends on the quality of care provided. Communications from customer service representatives (service representatives or representatives) should be timely, accurate, sensitive, brief, and friendly, which ultimately improves the customer satisfaction and brand loyalty.
Prerequisites
Make sure channels are provisioned in your environment. Learn more in Provision channels.
For newly created Twilio accounts, you must disable a security setting that blocks the ability to send media files. Learn more in Extended notice and update on security changes: HTTP Authentication for Voice and Messaging Media enabled by default.
Obtain a Twilio account with an appropriate subscription or a Twilio sandbox account. Learn more about configuring a Twilio sandbox account in Integrate a Twilio sandbox account.
Connect Twilio Number to your WhatsApp Business Profile. Learn more in Connect your Twilio Number to your WhatsApp Business Profile.
Verify that you have permissions on the secure columns. Learn more in Configure permissions to access secure columns.
WhatsApp message types and 24-hour session rule
- Template messages: Are the outbound messages that service representatives send through Twilio using one of the preapproved templates? They're typically transactional messages, such as delivery alerts and appointment reminders, sent to users who have opted in to receive messages from your organization. For messages requiring localization, you must get the message approved by WhatsApp in each language. Learn more about WhatsApp message templates in WhatsApp documentation.
Important
On April 1, 2025, the WhatsApp Template Console Tab and Templates API will be deprecated. To create new WhatsApp templates, you must use the Twilio Content Template Builder.
Before April 1, 2025, we recommend that you complete the following actions to avoid service disruptions:
- Migrate your existing WhatsApp templates to the Content Template Builder in Twilio.
- In either the Dynamics 365 Contact Center or Customer Service admin center app, update your WhatsApp message templates to use Content Template SID instead of Template Name.
Currently, each content template set can have one language only. If you want to use the same template in multiple languages, you must create a separate content template for each language. Learn more in Create a content template.
Session messages: According to WhatsApp, session messages are incoming messages from a customer or outgoing replies by a representative to the incoming messages, within 24 hours. A messaging session starts when representatives receive a message from a customer. It lasts for 24 hours from the most recently received message. Session messages don't need to follow a template, and can include media attachments.
24 hours session rule: A messaging session starts when a representative receives a message from a customer or replies to the incoming message from the customer. When the customer sends a message, the representative has 24 hours to reply from the time it was received. However, after 24 hours, the representative can send a message to customer only by using a predefined and approved template.
End-to-end walkthrough
- Fetch Twilio account details
- Create a WhatsApp channel
- Create routing rules
- Modify settings for a specific WhatsApp phone number
Fetch Twilio account details
To integrate a WhatsApp channel through Twilio with the Customer Service admin center or Contact Center admin center application, you need to go to your Twilio account and fetch the ACCOUNT SID and AUTH TOKEN values. Save the values as they're required to configure a WhatsApp channel through the admin application.
Go to your Twilio Console Dashboard > Settings > General to fetch the details.
Create a WhatsApp channel
In the site map of Customer Service admin center or Contact Center admin center, select Channels in Customer support. The Channels page displays.
Select Manage for Messaging accounts. The Accounts and channels page displays.
Select New account.
Enter the following details:
On the Channel details page, enter a name and select WhatsApp in Channels.
On the Account details page, enter the following details:
- Account SID: Specify the value from your Twilio account.
- Authentication token: Specify the value from your Twilio account.
- On the WhatsApp numbers page, select Add, and on the page that displays, enter the following information:
- Name: Specify a name.
- Number: Specify the WhatsApp phone number by prefixing the plus (+) symbol.
On the Callback information page, copy the value in the Twilio inbound URL box to use for the Twilio account.
Select Done. The account is added to the list.
To configure routing and work distribution, you can create a workstream or select an existing one.
Select the workstream that you've created for the WhatsApp channel and on the workstream page, select Set up WhatsApp to configure the following options:
On the WhatsApp number page, in the Available WhatsApp numbers list, select the number that you created.
On the Language page, select the language.
On the Behaviors page, configure the following options:
- On the User features page, set the toggle for File attachments to On and select the following checkboxes if you want to allow representatives and customers to send and receive file attachments. Learn more in Enable file attachments.
- Customers can send file attachments
- Representatives can send file attachments
- Verify the settings on the Summary page, and select Finish. The WhatsApp channel instance is configured.
Configure routing rules. Learn more in Configure work classification.
Configure work distribution. Learn more in Work distribution settings.
Optionally, add an agent.
Based on your business needs, in Advanced settings, configure the following options:
Configure WhatsApp message templates
You can configure the option for representatives to send WhatsApp-approved messages. If 24 hours pass after a customer's last message, representatives will only be able to send messages from WhatsApp-approved templates until the customer responds. You must create your message templates in your Twilio account and have them approved by WhatsApp before you add them in Dynamics 365 Contact Center or Dynamics 365 Customer Service.
Perform the following steps:
- For the selected workstream for WhatsApp, edit the WhatsApp account.
- On the Behaviors tab, in WhatsApp message templates, select Add.
- On the Add message template dialog box, do the following:
- Content template SID: Specify a content template SID.
- Default language: Select the language from the list.
- WhatsApp approved text: Copy and paste the approved text from the template that you created in WhatsApp.
- Select Save.
- Create as many templates as required.
Integrate omnichannel application with a Twilio sandbox account
- In Twilio, go to the Programmable SMS > Programmable Messaging > WhatsApp sandbox.
- In the WHEN A MESSAGE COMES IN box, enter the Twilio inbound URL that you generated in the application, and save the changes.
- To test the WhatsApp channel with the Twilio sandbox, you can send a WhatsApp message to the number provided by Twilio with a unique code that is also provided by Twilio. You can also use the sandbox message template provided by Twilio to test sending messages outside of the 24-hour window.
Related information
Understand and create workstreams
Configure automated messages
Configure a post-conversation survey
Skill-based routing
Create message templates
Templates
Delete a configured channel
Support for live chat and asynchronous channels