Skip to main content

Microsoft Dynamics 365 Connector

Microsoft Dynamics 365 Query, create, update or delete Microsoft Dynamics 365 API records

Connections

MS Dynamics OAuth 2.0 Auth Code

Microsoft Dynamics 365 OAuth Connection

The OAuth 2.0 auth code flow allows your user grant permission to your integration to interact with Dynamics on their behalf.

  1. Log in to Azure Portal
  2. Select App registrations
  3. Click + New registration
    • Supported account types should be Multi-tenant if you intend for customers to authenticate with their own Dynamics instance, or Single-tenant if you intend to authenticate with your own Dynamics instance.
    • Under Redirect URI enter https://oauth2.integrations.acme.com/callback
    • Click Register
  4. Under API permissions click +Add a permission
    • Select Dynamics CRM
    • Check the user_impersonation permission
    • Click Add permissions
    • Additionally, ensure the offline_access scope is included in your app registration. It is essential to maintain your OAuth connection and receive refresh tokens. Without it, users will need to re-authenticate every hour.
  5. Under Certificates & secrets click + New client secret
    • Give your certificate a description and expiration date
    • Take note of the value (not the Secret ID) of the client secret.
  6. Returning to the Overview page, take note of Application (client) ID

Create a connection of type MS Dynamics OAuth 2.0 Auth Code.

  • Enter the Client ID and Secret Value you noted above.
  • Log in to Dynamics and take note of the Dynamics URL.
    • Enter that Dynamics URL as the Web API URL. It should look like https://REPLACE-ME.crm.dynamics.com/
    • Under scopes, enter the following, replacing the URL with your Dynamics URL: https://REPLACE-ME.crm.dynamics.com/user_impersonation offline_access

This connection uses OAuth 2.0, a common authentication mechanism for integrations. Read about how OAuth 2.0 works here.

InputCommentsDefault
Web API URLYour organization's Microsoft Dynamics 365 Web API URL.
ScopesA space-delimited set of one or more scopes to get the user's permission to access.
Client ID
Client Secret

MS Dynamics OAuth 2.0 Client Credentials

OAuth 2.0 Client Credentials Connectivity for Microsoft Dynamics

The OAuth 2.0 client credentials flow allows your user to create an Application User to send requests to Dynamics on their behalf. Setting up a client credentials connection is a two-step process:

  1. Create an "App" in Azure
  2. Create an "Application User" in Dynamics

Create an app in Microsoft Azure

  1. Log in to Azure Portal
  2. Select App registrations
  3. Click + New registration
    • Supported account types can be Single tenant
    • No Redirect URI is necessary
    • Click Register
  4. Under API permissions click +Add a permission
    • Select Dynamics CRM
    • Check the user_impersonation permission
    • Click Add permissions
  5. Under API permissions click Grant admin concent for (your org)
  6. Under Certificates & secrets click + New client secret
    • Give your certificate a description and expiration date
    • Take note of the value (not the Secret ID) of the client secret.
  7. Returning to the Overview page, take note of Application (client) ID
  8. From the Overview page, click Endpoints and take note of the OAuth 2.0 token endpoint (v2)

You will use the Secret Value, Client ID and Token Endpoint in a moment.

Add the app as an App User to Dynamics

  1. Log in to Power Platform admin center
  2. Select Environments and choose your Dynamics Environments
  3. Select S2S Apps
  4. Click +New app user
    • Click +Add an app
    • Choose the app you created in Azure portal (above). You can search for your app by entering the client ID you noted.
    • Select your Dynamics tenant as your Business unit
    • Under Security Roles select System Administrator
    • Click Create

Configure the connection

Create a connection of type MS Dynamics OAuth 2.0 Client Credentials.

  • Enter the Token Endpoint you noted as your Token URL.
  • Enter the Client ID and Secret Value you noted above.
  • Log in to Dynamics and take note of the Dynamics URL.
    • Enter that Dynamics URL as the Web API URL. It should look like https://REPLACE-ME.crm.dynamics.com/
    • Under scopes, enter the Dynamics URL with .default appended to it - https://REPLACE-ME.crm.dynamics.com/.default

This connection uses OAuth 2.0, a common authentication mechanism for integrations. Read about how OAuth 2.0 works here.

InputCommentsDefault
Web API URLYour organization's Microsoft Dynamics 365 Web API URL.
Token URLThis can be found by visiting your app in Azure portal and selecting 'Endpoints'
ScopesThis should be your Dynamics URL with '/.default' appened to it
Client IDGenerated when you register an app in Azure portal
Client secret valueGenerated when you register an app in Azure portal

Triggers

Webhook

Receive and validate webhook requests from Microsoft Dynamics for webhooks you configure.

Actions

[CRM] Batch Entity Actions

Perform multiple create/update/delete actions on Microsoft Dynamics 365 CRM entity records.

InputCommentsDefault
Connection
Batch ActionsA list of up to 1000 create, update or delete actions to perform. Each action must have a 'collection' and an 'action' (create, update or delete). Create or update actions must also have 'data' and can include a boolean 'returnRepresentation' which determines if the full record should be returned after being created or updated. Update or delete actions must also have an entity key.
[
{
"collection": "msevtmgt_events",
"action": "create",
"returnRepresentation": true,
"data": {
"msevtmgt_name": "Test Event 1",
"msevtmgt_eventtype": "100000002"
}
},
{
"collection": "msevtmgt_events",
"action": "update",
"key": "00000000-0000-0000-0000-000000000002",
"returnRepresentation": true,
"data": {
"msevtmgt_name": "Test Event 2",
"msevtmgt_eventtype": "100000002"
}
},
{
"collection": "msevtmgt_events",
"action": "delete",
"key": "00000000-0000-0000-0000-000000000002"
}
]

[CRM] Create Attribute

Create a CRM Attribute on an Entity

InputCommentsDefault
Connection
Entity IDThe ID of a specific Entity record
Attribute BodyAttribute body payload to send
{
"AttributeType": "Money",
"AttributeTypeName": {
"Value": "MoneyType"
},
"Description": {
"@odata.type": "Microsoft.Dynamics.CRM.Label",
"LocalizedLabels": [
{
"@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel",
"Label": "Enter the balance amount",
"LanguageCode": 1033
}
]
},
"DisplayName": {
"@odata.type": "Microsoft.Dynamics.CRM.Label",
"LocalizedLabels": [
{
"@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel",
"Label": "Balance",
"LanguageCode": 1033
}
]
},
"RequiredLevel": {
"Value": "None",
"CanBeChanged": true,
"ManagedPropertyLogicalName": "canmodifyrequirementlevelsettings"
},
"SchemaName": "new_Balance",
"@odata.type": "Microsoft.Dynamics.CRM.MoneyAttributeMetadata",
"PrecisionSource": 2
}

[CRM] Create Entity

Create a new Microsoft Dynamics 365 CRM entity record.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name
Dynamic Values
Field ValueThe names of the fields and their values to use when creating/updating a record
Connection

[CRM] Delete Entity

Delete the specified Microsoft Dynamics 365 CRM entity record.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name
Entity IDThe ID of a specific Entity record
Connection

[CRM] Get Attribute

Retrieve a single CRM Attribute

InputCommentsDefault
Connection
Entity IDThe ID of a specific Entity record
Attribute KeyThe Attribute Metadata id
Field NameThe names of the fields to retrieve
Expand Property NameThe names of entity properties to linked entities that should be included

[CRM] Get Current User

Get information about the currently logged in CRM user

InputCommentsDefault
Connection

[CRM] Get Entities Metadata

A subset of Dynamics CRM Entity Types.

InputCommentsDefault
Connection
Default Selected Entity TypesThe names of the Entity Types to default in a selected state.
Entity Type FilterThe names or labels of the Entity Types to include; if blank then all types are included. Uses case-insensitive matching.
Include All Custom Entity TypesWhen true, will include all Custom Entity Types, even those not included in Record Type Name Filter.true
Include Only Top Level Record TypesWhen true, will include only Entity Types that are top-level, meaning not subtypes of other Types, regardless of other filters.false

[CRM] Get Entity

Retrieve a single Microsoft Dynamics 365 CRM entity record.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name
Entity IDThe ID of a specific Entity record
Field NameThe names of the fields to retrieve
Expand Property NameThe names of entity properties to linked entities that should be included
Connection

[CRM] Get Entity Metadata

Get definition of Microsoft Dynamics 365 CRM entity.

InputCommentsDefault
Connection
Entity TypeThe type of Entity to query, usually a pluralized name
Use Logical Name for Lookuptrue

[CRM] List Attributes

Get a list of all attributes for a specific entity in your Dynamics 365 CRM instance

InputCommentsDefault
Connection
Entity IDThe ID of a specific Entity record
Attribute Type FilterFilter by attribute type (e.g., 'String', 'Integer', 'Boolean', 'DateTime', 'Decimal')
Include Attribute DetailsInclude additional attribute metadata like schema name, security settings, etc.false

[CRM] List Entities

Get a list of all available entities in your Dynamics 365 CRM instance with detailed metadata

InputCommentsDefault
Connection
Include Custom EntitiesInclude custom entities in the list.true
Top Level OnlyInclude only top-level entities (exclude child entities).false
Include Entity DetailsInclude additional entity metadata like description, ownership type, etc.false

[CRM] Query Attributes

Query for CRM Attributes that satisfy the filter expression

InputCommentsDefault
Connection
Entity IDThe ID of a specific Entity record
Attribute TypeThe type of Attribute to query
Field NameThe names of the fields to retrieve
Filter ExpressionThe filter expression that used for querying entity collections
Expand Property NameThe names of entity properties to linked entities that should be included

[CRM] Query Entities

Query for Microsoft Dynamics 365 CRM entity records that satisfy the filter expression.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name
Field NameThe names of the fields to retrieve
Filter ExpressionThe filter expression that used for querying entity collections
Order By Field NameThe names of the fields to order by
Expand Property NameThe names of entity properties to linked entities that should be included
Records Per PageThe number of record to retrieve per page100
Next Page IdThe id or cookie to use for retrieving the next page of results when paginating through a large result set
Connection

[CRM] Raw Request

Send raw HTTP request to Microsoft Dynamics 365 CRM

InputCommentsDefault
Connection
URLInput the path only (/api/data/v9.2/accounts?$select=name), The base URL is already included (https://my-org.api.crm.dynamics.com). For example, to connect to https://my-org.api.crm.dynamics.com/api/data/v9.2/accounts?$select=name, only /api/data/v9.2/accounts?$select=name is entered in this field.
MethodThe HTTP method to use.
DataThe HTTP body payload to send to the URL.
Form DataThe Form Data to be sent as a multipart form upload.
File DataFile Data to be sent as a multipart form upload.
File Data File NamesFile names to apply to the file data inputs. Keys must match the file data keys above.
Query ParameterA list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.
HeaderA list of headers to send with the request.
Response TypeThe type of data you expect in the response. You can request json, text, or binary data.json
TimeoutThe maximum time that a client will await a response to its request
Debug RequestEnabling this flag will log out the current request.false
Retry Delay (ms)The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.0
Retry On All ErrorsIf true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.false
Max Retry CountThe maximum number of retries to attempt. Specify 0 for no retries.0
Use Exponential BackoffSpecifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.false

[CRM] Run Fetch XML Query

Execute a fetch XML query against your Microsoft Dynamics 365 CRM instance.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name
XML QueryAn XML query string to use as a Fetch query in Microsoft Dynamics 365
Include AnnotationsSpecifies annotations to include with the result
Page NumberThe page number to request
Next Page IdThe id or cookie to use for retrieving the next page of results when paginating through a large result set
Impersonate User IdSpecifies the GUID of a user to impersonate when executing the query
Connection

[CRM] Update Attribute

Update an existing CRM Attribute on an Entity

InputCommentsDefault
Connection
Entity IDThe ID of a specific Entity record
Attribute BodyAttribute body payload to send
{
"AttributeType": "Money",
"AttributeTypeName": {
"Value": "MoneyType"
},
"Description": {
"@odata.type": "Microsoft.Dynamics.CRM.Label",
"LocalizedLabels": [
{
"@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel",
"Label": "Enter the balance amount",
"LanguageCode": 1033
}
]
},
"DisplayName": {
"@odata.type": "Microsoft.Dynamics.CRM.Label",
"LocalizedLabels": [
{
"@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel",
"Label": "Balance",
"LanguageCode": 1033
}
]
},
"RequiredLevel": {
"Value": "None",
"CanBeChanged": true,
"ManagedPropertyLogicalName": "canmodifyrequirementlevelsettings"
},
"SchemaName": "new_Balance",
"@odata.type": "Microsoft.Dynamics.CRM.MoneyAttributeMetadata",
"PrecisionSource": 2
}

[CRM] Update Entity

Update a Microsoft Dynamics 365 CRM entity record.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name
Entity IDThe ID of a specific Entity record
Field ValueThe names of the fields and their values to use when creating/updating a record
Dynamic Values
Connection

[CRM] Upsert Entity

Upsert a Microsoft Dynamics 365 CRM entity record.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name
Entity IDThe ID of a specific Entity record
Field ValueThe names of the fields and their values to use when creating/updating a record
Dynamic Values
Connection

List Entity Types

Retrieve a list of entity types available in your Microsoft Dynamics 365 environment with pagination support

InputCommentsDefault
Connection
Max Page SizeMaximum number of entities to return per page (1-5000). Defaults to 5000 if not specified.5000
Next LinkThe @odata.nextLink URL from a previous response to get the next page of results

Raw Request

Send raw HTTP request to Microsoft Dynamics 365

InputCommentsDefault
Connection
URLInput the path only (/api/data/v9.2/accounts?$select=name), The base URL is already included (https://my-org.api.crm.dynamics.com). For example, to connect to https://my-org.api.crm.dynamics.com/api/data/v9.2/accounts?$select=name, only /api/data/v9.2/accounts?$select=name is entered in this field.
MethodThe HTTP method to use.
DataThe HTTP body payload to send to the URL.
Form DataThe Form Data to be sent as a multipart form upload.
File DataFile Data to be sent as a multipart form upload.
File Data File NamesFile names to apply to the file data inputs. Keys must match the file data keys above.
Query ParameterA list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.
HeaderA list of headers to send with the request.
Response TypeThe type of data you expect in the response. You can request json, text, or binary data.json
TimeoutThe maximum time that a client will await a response to its request
Debug RequestEnabling this flag will log out the current request.false
Retry Delay (ms)The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.0
Retry On All ErrorsIf true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.false
Max Retry CountThe maximum number of retries to attempt. Specify 0 for no retries.0
Use Exponential BackoffSpecifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.false