How to Integrate Dynamics 365 with WhatsApp
In this article
You can integrate Dynamics 365 with WhatsApp, but not through a single built-in toggle. Microsoft does not ship a native WhatsApp channel in Dynamics 365 Sales or Customer Service. The practical route is to connect WhatsApp Business Platform (the official API) to Dynamics 365 through an integration platform such as Power Automate, Azure Logic Apps, or a certified third-party connector. This lets you capture WhatsApp messages as leads or cases, send replies from Dynamics 365, and keep conversation history on the record. Before you start, you need a WhatsApp Business Account (WABA) approved by Meta, a phone number that is not already registered to a personal WhatsApp account, and the right Dynamics 365 licences and environment access.
What You'll Need
- A Facebook Business Manager account with admin access.
- A WhatsApp Business Account (WABA) and a phone number verified for the WhatsApp Business Platform. This is not the free WhatsApp Business app; it is the API product.
- A Meta system user and a permanent access token with the
whatsapp_business_messagingandwhatsapp_business_managementpermissions. - A Dynamics 365 environment (Sales or Customer Service) with system administrator rights to create fields, entities, and workflows.
- A Power Automate licence that includes premium connectors, or an Azure subscription if you use Logic Apps.
- An integration platform or connector that supports WhatsApp Business Platform. Examples include the Power Automate WhatsApp Business connector (where available in your region) or a third-party connector from the Microsoft commercial marketplace.
- An HTTPS endpoint or webhook URL to receive incoming messages. Power Automate can provide this through an HTTP trigger.
Step-by-Step
- Create and verify your WhatsApp Business Account. In Meta Business Suite, go to Business Settings > Accounts > WhatsApp Accounts and add a new account. Complete business verification and verify the phone number you will use. Note the WABA ID and the phone number ID shown in the account settings.
- Generate a permanent access token. In Meta Business Suite, go to Business Settings > Users > System Users. Create a system user with admin role, assign the WhatsApp Business Account and the app, then generate a token with the messaging and management permissions. Store the token securely; it will not be shown again.
- Set up a webhook to receive messages. In the Meta app dashboard for your WhatsApp product, open the Configuration section and add a callback URL. This URL must be publicly reachable over HTTPS. If you use Power Automate, create a flow with an HTTP request trigger, copy its URL, and use the verify token you choose. Meta will send a challenge request; your flow must return the challenge value to complete verification.
- Subscribe to message events. In the same webhook configuration, subscribe to the
messagesfield so Meta sends incoming messages to your endpoint. Without this subscription, the webhook verifies but no messages arrive. - Create a place to store conversations in Dynamics 365. Decide whether each WhatsApp conversation becomes a Lead, a Case, or a custom entity. Add fields for the WhatsApp phone number, the WhatsApp message ID, the direction (inbound or outbound), and the message text. If you use the standard Phone Call or Email entities, note that they do not natively store WhatsApp message IDs, so a custom entity or added fields are usually cleaner.
- Build the inbound flow. In Power Automate, use the HTTP trigger to receive the Meta payload. Parse the JSON to extract the sender's phone number, the message text, and the message ID. Use a Dataverse action to search for an existing contact or case by phone number. If none exists, create a lead or case. Then create a record for the message itself and link it to the parent record. Add a condition to ignore status updates and delivery receipts so you do not create duplicate records.
- Build the outbound flow. Create a flow that triggers when a user sends a reply from Dynamics 365, for example when a new outbound message record is created. Use the WhatsApp Business connector or an HTTP action to call the WhatsApp Cloud API send-message endpoint with your phone number ID, the recipient's number, and the message text. Log the response message ID back on the Dynamics 365 record so you can match delivery status later.
- Handle the 24-hour customer service window. WhatsApp allows free-form replies only within 24 hours of the customer's last message. Outside that window, you must use a pre-approved message template. Build a template in Meta Business Suite, wait for approval, and add a branch in your outbound flow that sends a template instead of free text when the window has expired.
- Test with a real number. Send a message from a personal WhatsApp account to your business number. Confirm the lead or case appears in Dynamics 365, the message text is stored, and a reply sent from Dynamics 365 arrives on the phone. Test both inside and outside the 24-hour window.
- Secure and monitor the integration. Restrict who can edit the flows, store tokens in Azure Key Vault or Power Automate secure inputs rather than in plain text, and set up alerts on failed flow runs. Review the Meta webhook logs and Power Automate run history weekly for the first month.
Common Mistakes
- Using the free WhatsApp Business app instead of the WhatsApp Business Platform. The app has no API and cannot be integrated this way.
- Forgetting to subscribe to the
messageswebhook field, so the webhook verifies but no messages ever arrive. - Using a temporary access token that expires after 24 hours, which breaks the integration silently.
- Not filtering out delivery statuses and read receipts, which creates duplicate or empty records in Dynamics 365.
- Sending free-form text outside the 24-hour window, which the API rejects. Use an approved template instead.
- Storing the access token in plain text inside a flow or a Dynamics 365 field.
Tips
- Map the WhatsApp phone number to a Dynamics 365 contact using the full international format, including the country code and without spaces or plus signs.
- Create a separate custom entity for WhatsApp messages rather than overloading Email or Phone Call. It keeps reporting clean and avoids conflicts with standard behaviour.
- Use Power Automate solutions to move flows between environments instead of rebuilding them by hand.
- Log both the inbound and outbound message IDs. They are the only reliable way to match delivery status callbacks to the right record.
- Start with a single number and a single queue before rolling out to a team.
Troubleshooting
If the webhook verification fails, check that your endpoint is publicly reachable over HTTPS, that the verify token in Meta matches the one in your flow exactly, and that the flow returns the challenge value as plain text, not JSON. If messages arrive at Meta but not in Dynamics 365, open the Power Automate run history and look for a failed parse step; the payload structure changes when customers send media, so add conditions for message types you do not handle. If outbound replies fail with an authentication error, regenerate the permanent token and update it in your connector. If replies fail only after a day of inactivity, you are almost certainly outside the 24-hour window and need a template. If duplicate records appear, add a condition to skip messages whose ID already exists in your custom entity. If nothing works after these checks, disable the flow, re-verify the webhook from scratch, and test with a single message before re-enabling.
Frequently Asked Questions
Does Dynamics 365 have a native WhatsApp channel?
No. Microsoft does not provide a built-in WhatsApp channel in Dynamics 365 Sales or Customer Service. Integration requires the WhatsApp Business Platform API plus Power Automate, Logic Apps, or a certified connector.
Can I use my existing personal WhatsApp number?
No. The WhatsApp Business Platform requires a number that is not active on a personal WhatsApp account. You must verify a separate number for the business account.
Do I need a third-party connector?
Not strictly. You can call the WhatsApp Cloud API directly from Power Automate or Logic Apps using HTTP actions. A connector can save setup time but is not mandatory.
What happens after the 24-hour window closes?
Free-form replies are blocked. You must send a pre-approved message template until the customer messages you again, which reopens the window.
Can I receive images and documents?
Yes, the API delivers media messages, but you must download the media separately using the media ID and store it in Dynamics 365 or SharePoint. Your flow needs an extra step for this.
Is this suitable for a small team?
Yes, but plan the record structure first. A custom entity for messages and a clear lead or case routing rule will save rework as the team grows.