- Introduction
- Microsoft Dynamics 365 Online Configuration
- General
- 3CX CRM Server-side Configuration
- Contact Matching Strategy
- General Settings
- Call Journaling
- Chat Journaling
- Contact Creation
- Click to Call
- See Also
Introduction
3CX provides integration with Microsoft Dynamics 365 online CRM via the 3CX API for CRM. The configuration is done server-side, in an easy and straightforward way. This integration provides many benefits to users of 3CX and Microsoft Dynamics 365, including:
- Contact Synchronization– Inbound / outbound calls from / to external numbers trigger a CRM contact lookup to add to 3CX Contacts, so the contact name is automatically shown on your phone’s display when dealing with a call.
- Call Pop-ups– when using the 3CX Web Client or Desktop App, the customer record is brought up to you automatically when you receive an inbound call.
- Call Journals– Calls are logged as call records in the CRM.
- Chat Journals– Chats are logged as letter records in the CRM.
- Create a new contactautomatically when a call is made or received from / to an unknown number.
- Click to Call– Launch calls straight from Microsoft Dynamics 365 via 3CX, using the 3CX Click2Call Browser extensions for Google Chromeand Microsoft Edge.
This guide takes you through the steps required to set up your Microsoft Dynamics 365 with 3CX.
Microsoft Dynamics 365 Online Configuration
General
- Go to the Microsoft Azure App Registrationspageusing your Microsoft Dynamics 365 Online account, i.e. “Azure services” > “App registrations”.
- Click on “New registration” and complete the app information
- “Name” - enter the app’s name, e.g. “3CX Server-side”.
- “Supported account types” - leave default or update based on your needs.
- “Redirect URI (optional)” - select “Public client/native (mobile & desktop)”. For the Redirect URI enter
https://my-pbx.example.com:5001/api/oauth2crm
, using the URL for your 3CX Management Console. - Click “Register” to proceed with the app registration.
- In the app “Overview” page, note the values of these fields for configuring 3CX later:
- “Application (client) ID”.
- “Directory (tenant) ID”.
- To add the required permissions to access the Microsoft Dynamics 365 Online information, click on “API permissions” > “Add a permission” > “Dynamics CRM”.
- Enable the “user_impersonation” permission and click on “Add permissions”.
- Wait for ~10 minutes for the app changes to become available.
Call & Chat Journaling
To report external calls and chats to Microsoft Dynamics 365, the email address configured for the 3CX extension must match the email address of a Microsoft Dynamics 365 user. This way 3CX can map the 3CX extension receiving the call or chat to the Microsoft Dynamics 365 user.
3CX CRM Server-side Configuration
Contact Matching Strategy
To get a match with Microsoft Dynamics 365, the incoming Caller ID must be identicalto the CRM entry, including any prefix. Querying Microsoft Dynamics 365 using a subset of the digits, does not return any data. Microsoft Dynamics 365 can store the numbers in E164 format, so ensure that your SIP Trunk provides the caller’s number in E164 format as well, so both match. Otherwise, you can use Caller ID Reformattingto adjust the caller’s number before being passed on to the CRM.
⚠ Important: In 3CX Management Console, open “Advanced” > “Contacts” > “Options”, set the matching strategy to "Match exactly" and click “OK” to save.
⚠ Important: Storing numbers in Microsoft Dynamics 365 with spaces, dashes, or any non-numeric character except by the plus (+) prefix will cause that the contact can’t be matched.
General Settings
- Login to the 3CX Management Console and go to “Settings” > “CRM Integration” > “Server Side” tab.
- Select Microsoft Dynamics 365 from the dropdown list.
- Enter the values for the Application ID and Tenant, taken from the previous steps. For the domain, enter the URL you use to access your Microsoft Dynamics 365 Online account.
- Press the Authorize button to perform the authorization. A new tab will be opened, and you will be requested to grant access to the application you just created.
- Press Accept to grant access. The refresh token will be shown under the Authorize button.
Call Journaling
- If you want to report external calls to the CRM, check the Enable Call Journaling checkbox and configure the parameters below.
- Call Journaling parameters are:
- Call Subject: The subject of the call.
- Answered Inbound Call: Description for answered inbound calls.
- Missed Call: Description for missed calls.
- Answered Outbound Call: Description for answered outbound calls.
- Unanswered Outbound Call: Description for unanswered outbound calls
- Please note that you can use variables in the Call Journaling parameters. Variables are specified between [], for example the external number is specified as [Number]. The available variables are:
CallType
- The type of call, it can be “Inbound”, “Outbound”, “Missed”, or “Unanswered”.Number
- The external contact number (the number dialed for outbound calls or the caller number for inbound calls).CallDirection
- The direction of the call, either "Inbound" or "Outbound".Name
- The name of the matched contact.EntityId
- The ID of the matched contact.EntityType
- The type of the matched contact (i.e. "Contacts").Agent
- The extension number of the agent handling the call.AgentFirstName
- The first name of the agent handling the call.AgentLastName
- The last name of the agent handling the call.AgentEmail
- The email of the agent handling the call.Duration
- The duration of the call in “hh:mm:ss” format.DurationTimeSpan
- The duration of the call as a TimeSpan object, which can be formatted as the user wants.DateTime
- The start date & time of the call, in the local time zone, formatted using the local culture from the 3CX server.CallStartTimeLocal
- The start date & time of the call, in the local time zone, as a DateTime object, which can be formatted as the user wants.CallStartTimeUTC
- The start date & time of the call, in UTC time zone, as a DateTime object, which can be formatted as the user wants.CallEstablishedTimeLocal
- The date & time in which the call was established, in the local time zone, as a DateTime object, which can be formatted as the user wants.CallEstablishedTimeUTC
- The date & time in which the call was established, in UTC time zone, as a DateTime object, which can be formatted as the user wants.CallEndTimeLocal
- The end date & time of the call, in the local time zone, as a DateTime object, which can be formatted as the user wants.CallEndTimeUTC
- The end date & time of the call, in UTC time zone, as a DateTime object, which can be formatted as the user wants.CallStartTimeLocalMillis
- The start date & time of the call, in the local time zone, expressed as milliseconds since epoch (aka unix time).CallStartTimeUTCMillis
- The start date & time of the call, in UTC time zone, expressed as milliseconds since epoch (aka unix time).CallEstablishedTimeLocalMillis
- The date & time in which the call was established, in the local time zone, expressed as milliseconds since epoch (aka unix time).CallEstablishedTimeUTCMillis
- The date & time in which the call was established, in UTC time zone, expressed as milliseconds since epoch (aka unix time).CallEndTimeLocalMillis
- The end date & time of the call, in the local time zone, expressed as milliseconds since epoch (aka unix time).CallEndTimeUTCMillis
- The end date & time of the call, in UTC time zone, expressed as milliseconds since epoch (aka unix time).
Chat Journaling
- If you want to report chats to the CRM, check the Enable Chat Journaling checkbox and configure the parameters below.
- Chat Journaling parameters are:
- Chat Subject: The subject of the chat session.
- Please note that you can use variables in the Chat Journaling parameters. Variables are specified between [], for example the external number is specified as [Number]. The available variables are:
Number
- The external contact number (only available when this is a chat through SMS).Email
- The external contact email address (only available when this is a chat through Live Chat).Name
- The name of the matched contact.EntityId
- The ID of the matched contact.EntityType
- The type of the matched contact (i.e. "Contacts").QueueExtension
- The extension number of the queue, only when the chat arrives to the agent through a queue.ChatMessages
- The messages sent and received during the chat session.Agent
- The extension number of the agent handling the chat.AgentFirstName
- The first name of the agent handling the chat.AgentLastName
- The last name of the agent handling the chat.AgentEmail
- The email of the agent handling the chat.Duration
- The duration of the chat in “hh:mm:ss” format.DurationTimeSpan
- The duration of the chat as a TimeSpan object, which can be formatted as the user wants.DateTime
- The start date & time of the chat, in the local time zone, formatted using the local culture from the 3CX server.ChatStartTimeLocal
- The start date & time of the chat, in the local time zone, as a DateTime object, which can be formatted as the user wants.ChatStartTimeUTC
- The start date & time of the chat, in UTC time zone, as a DateTime object, which can be formatted as the user wants.ChatEndTimeLocal
- The end date & time of the chat, in the local time zone, as a DateTime object, which can be formatted as the user wants.ChatEndTimeUTC
- The end date & time of the chat, in UTC time zone, as a DateTime object, which can be formatted as the user wants.ChatStartTimeLocalMillis
- The start date & time of the chat session, in the local time zone, expressed as milliseconds since epoch (aka unix time).ChatStartTimeUTCMillis
- The start date & time of the chat session, in UTC time zone, expressed as milliseconds since epoch (aka unix time).ChatEndTimeLocalMillis
- The end date & time of the chat session, in the local time zone, expressed as milliseconds since epoch (aka unix time).ChatEndTimeUTCMillis
- The end date & time of the chat session, in UTC time zone, expressed as milliseconds since epoch (aka unix time).
Contact Creation
- If you want to create new contacts in the CRM when a call is received from an unknown number (not found in both 3CX and CRM), check the Enable Contact Creation checkbox and configure the parameters below.
- Contact Creation parameters are:
- Create Contacts on Call Direction - Select if you want 3CX to create contacts on Inbound calls only, or also on Outbound calls.
- Create Lead or Contact - The entity to be created (Lead/Contact).
- New Contact First Name - The first name of the newly created Contact.
- New Contact Last Name - The last name of the newly created Contact.
- New Lead Subject - The Lead subject when a Lead is created.
- Please note that you can use variables in the parameters. Variables are specified between [], for example the external number is specified as [Number]. The available variables are:
Number
- The external contact number (the number dialed for outbound calls or the caller number for inbound calls).CallDirection
- The direction of the call, either "Inbound" or "Outbound".
Click to Call
Microsoft Dynamics 365 renders phone numbers as click to call with Skype links by default, which prevents the click to call functionality from working with 3CX.
In order to solve this, the following configuration must be changed in Dynamics 365:
- On the upper right corner of the screen go to “Settings” > “Advanced Settings”.
- Go to “System” > “Administration”, and then “System Settings” to change the following value:
- Set the telephony provider > Skype for Business / Lync
Once this configuration has been changed, Microsoft Dynamics 365 will render phone numbers as links using the “tel” protocol. Also the Phone icon that Microsoft Dynamics 365 places on the right side of the phone number when editing a contact, triggers a call using the “tel” protocol. This protocol can be handled by the 3CX Desktop App for Windows, so you can use this client to make outbound calls from Microsoft Dynamics 365.
See Also
- See how to integrate your CRM with the 3CX API.
- Learn how to set up Microsoft 365 Integration.
Discuss this article