# Microsoft Dynamics 365
Microsoft Dynamics 365 (opens new window) is a customer relationship management software package developed by Microsoft. It is built on the Microsoft Dynamics 365 platform, allowing users to easily extend and tailor the application for their business.
# API version
The Microsoft Dynamics 365 connector uses the Microsoft Dynamics 365 API v8.0 and v9.0. Select your preferred version during connection.
# Connection setup
Complete the following steps to create a Microsoft Dynamics 365 connection in Workato.
Provide a Connection name that identifies which Microsoft Dynamics 365 instance Workato is connected to.
Select the Location where you plan to use your connection.
Select your Connection type.
CLOUD AND ON-PREMISE CONNECTION TYPES
Learn how to create a connection to your Microsoft Dynamics 365 instance through the cloud app or through your on-premise application.
Select the Authentication type you plan to use for your connection:
Click Sign in with Microsoft to complete your connection setup.
# Use a cloud connection
You must obtain a client ID by registering your Microsoft 365 Dynamics app with Azure Active Directory to connect to Microsoft 365 Dynamics on Workato. Complete the following steps to register with Microsoft 365 Dynamics:
Sign in to the Microsoft Azure management portal using an account with administrator permission. You must use an account in the same Microsoft Office 365 subscription (tenant) that you plan to register the app with.
Microsoft Azure homepage
Click App registrations > New registration.
App registrations
Provide a Name for the application. For example, Workato.
Register the application
Select Accounts in this organizational directory only (Nil only - Single tenant) in the Supported account types field.
Provide a Redirect URI. For example, https://www.workato.com/oauth/callback
.
Click Register.
Your new application displays on your app registrations page.
Select your new app to open the app details page.
Select your newly created application
Go to the Certificates & Secrets section and create a Client Secret. This is required for the connection setup in Workato.
Create a client secret
Click API permissions > Add a permission.
Click Add a permission
Click the Microsoft APIs tab and select Dynamics 365.
Select Dynamics 365 Online API access
Select Delegated permissions and the user_impersonation checkbox, then click Add permissions.
Add permissions
Retrieve the Application (client) ID. The client ID is required to connect to Workato.
Retrieve the Application ID
Retrieve the Client secret. The client secret is required to connect to Workato.
Retrieve client secret
Extend the refresh token expiration time if required.
# Use an on-premise connection
You must obtain a client ID by registering your Microsoft 365 Dynamics app with the Active Directory Federation Service before you can connect to Microsoft 365 Dynamics on Workato. Learn more about how to register an on-premise Dynamics app (opens new window) with Active Directory Federation Service.
Remember to extend the refresh token expiration time if required.
# Extend the refresh token expiration time
When you connect to a Dynamics app, Workato uses an access token to read and write to your Dynamics instance. This access token is valid until it reaches its expiry date. Workato receives an accompanying refresh token with the access token. When your access token expires, Workato uses the refresh token to request a new access token. Microsoft Dynamics 365 checks that the refresh token is still valid (the token has not been revoked), and provides a new pair of access and refresh tokens.
Refresh tokens also have expiry date. If both the access token and refresh tokens expire before Workato requests new tokens, the Microsoft Dynamics 365 connection becomes invalid, and a re-connection is required. When this happens, a request from Workato to Microsoft Dynamics 365 receives a 400 response. If you are using a Microsoft Dynamics 365 trigger, this results in a recipe trigger error. If you are using a Microsoft Dynamics 365 action, this results in a job error.
To ensure your recipes run continuously without requiring intervention, extend your refresh token expiration time, or set it to unlimited. You can apply and scope your token to an OAuth application instead of applying it to the entire organization.
Learn more about token lifetimes in the Microsoft documentation (opens new window).
Last updated: 8/29/2024, 5:29:18 PM