Skip to main content

Microsoft Dynamics 365 Connector

Microsoft Dynamics 365 Microsoft Dynamics 365 is a product line of enterprise resource planning (ERP) and customer relationship management (CRM) intelligent business applications. This component gives you the ability to query and modify records within the Microsoft Dynamics 365 platform.

Connections

OAuth 2.0 Authorization Code

Authenticate requests using OAuth 2.0 Authorization Code.

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 URLThe 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 IDGenerated when registering an application in the Azure portal.
Client SecretGenerated when registering an application in the Azure portal.

OAuth 2.0 Client Credentials

Authenticate requests using OAuth 2.0 Client Credentials.

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 URLThe organization's Microsoft Dynamics 365 Web API URL.
Token URLThe OAuth 2.0 token endpoint. This can be found in the Azure portal under the app's 'Endpoints' menu.
ScopesThe OAuth 2.0 scope. Use the Dynamics Web API URL with '/.default' appended (e.g., https://my-org.api.crm.dynamics.com/.default).
Client IDGenerated when registering an application in the Azure portal.
Client secret valueGenerated when registering an application in the Azure portal.

Triggers

Webhook

Receive and validate webhook requests from Microsoft Dynamics 365 for manually configured webhook subscriptions.

InputCommentsDefault
Webhook Authentication KeyOptional authentication key for incoming webhook requests. When set, requests must include this value in the '?code' query parameter (Microsoft Dynamics 'Webhook Key' authentication mode). Strongly recommended to prevent unauthorized event spoofing.

Actions

Create Attribute

Creates a CRM attribute on an entity.

InputCommentsDefault
Connection
Entity IDThe unique identifier (GUID) of the entity record to operate on.
Attribute BodyThe JSON payload describing the attribute to create or update.
{
"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
}

Create Entity

Creates 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

Delete Entity

Deletes the specified Microsoft Dynamics 365 CRM entity record.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name.
Entity IDThe unique identifier (GUID) of the entity record to operate on.
Connection

Get Attribute

Retrieves a single CRM attribute.

InputCommentsDefault
Connection
Entity IDThe unique identifier (GUID) of the entity record to operate on.
Attribute KeyThe Attribute Metadata id.
Field NameThe OData $select fields to include in the result. Leave empty to return all fields.
Expand Property NameThe OData $expand properties to include linked records inline.

Get Current User

Retrieves information about the currently logged-in CRM user.

InputCommentsDefault
Connection

Get Entities Metadata

Retrieves a configurable subset of Dynamics 365 CRM entity types and their attributes.

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

Get Entity

Retrieves a single Microsoft Dynamics 365 CRM entity record.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name.
Entity IDThe unique identifier (GUID) of the entity record to operate on.
Field NameThe OData $select fields to include in the result. Leave empty to return all fields.
Expand Property NameThe OData $expand properties to include linked records inline.
Connection

Get Entity Metadata

Retrieves the definition of a Microsoft Dynamics 365 CRM entity.

InputCommentsDefault
Connection
Entity TypeThe type of Entity to query, usually a pluralized name.
Use Logical Name for LookupWhen true, looks up the entity by its logical name (e.g., 'account'). When false, looks up by entity set name.true

List Attributes

Lists all attributes for a specific entity in the Dynamics 365 CRM instance.

InputCommentsDefault
Connection
Entity IDThe unique identifier (GUID) of the entity record to operate on.
Attribute TypeThe CRM attribute type to filter by, e.g., 'Money', 'String', 'Picklist'.
Include Entity DetailsWhen true, includes additional metadata such as description, ownership type, and validity flags.false

List Entities

Lists all available entities in the Dynamics 365 CRM instance with detailed metadata.

InputCommentsDefault
Connection
Include Custom EntitiesWhen true, includes custom entities in the result.true
Top Level OnlyWhen true, includes only top-level entities and excludes child entities.false
Include Entity DetailsWhen true, includes additional metadata such as description, ownership type, and validity flags.false

List Entity Types

Retrieves a paginated list of entity types available in the Microsoft Dynamics 365 environment.

InputCommentsDefault
Connection
Max Page SizeMaximum number of entities to return per page (1-5000).5000
Next LinkThe @odata.nextLink URL from a previous response to get the next page of results.
Fetch AllWhen true, automatically fetches all pages of results using pagination.false

Query Attributes

Queries CRM attributes that satisfy the filter expression.

InputCommentsDefault
Connection
Entity IDThe unique identifier (GUID) of the entity record to operate on.
Attribute TypeThe CRM attribute type to filter by, e.g., 'Money', 'String', 'Picklist'.
Field NameThe OData $select fields to include in the result. Leave empty to return all fields.
Filter ExpressionThe filter expression that used for querying entity collections.
Expand Property NameThe OData $expand properties to include linked records inline.

Query Entities

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

InputCommentsDefault
Connection
Entity TypeThe type of Entity to query, usually a pluralized name.
Field NameThe OData $select fields to include in the result. Leave empty to return all fields.
Filter ExpressionThe filter expression that used for querying entity collections.
Order By Field NameThe OData $orderby fields. Suffix with 'desc' for descending order, e.g., 'createdon desc'.
Expand Property NameThe OData $expand properties to include linked records inline.
Fetch AllWhen true, automatically fetches all pages of results using pagination.false
Records Per PageThe number of record to retrieve per page.100
Next Page IDThe pagination cookie returned in 'oDataNextLink' from a previous request. Leave empty for the first page.

Raw Request

Sends a 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
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

Raw Request (Deprecated)

Sends a 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
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

Run Batch Operations

Performs multiple create, update, or delete operations 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"
}
]

Run Fetch XML Query

Executes a Fetch XML query against the Microsoft Dynamics 365 CRM instance.

InputCommentsDefault
Connection
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 AnnotationsThe 'Prefer: odata.include-annotations' header value, e.g., '*' to include all annotations or 'OData.Community.Display.V1.FormattedValue' for formatted values only.
Impersonate User IDSpecifies the GUID of a user to impersonate when executing the query.
Fetch AllWhen true, automatically fetches all pages of results using pagination.false
Page NumberThe 1-based page number to retrieve when iterating through Fetch XML query results.
Next Page IDThe pagination cookie returned in 'oDataNextLink' from a previous request. Leave empty for the first page.

Update Attribute

Updates an existing CRM attribute on an entity.

InputCommentsDefault
Connection
Entity IDThe unique identifier (GUID) of the entity record to operate on.
Attribute BodyThe JSON payload describing the attribute to create or update.
{
"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
}

Update Entity

Updates a Microsoft Dynamics 365 CRM entity record.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name.
Entity IDThe unique identifier (GUID) of the entity record to operate on.
Field ValueThe names of the fields and their values to use when creating/updating a record.
Dynamic Values
Connection

Upsert Entity

Upserts a Microsoft Dynamics 365 CRM entity record.

InputCommentsDefault
Entity TypeThe type of Entity to query, usually a pluralized name.
Entity IDThe unique identifier (GUID) of the entity record to operate on.
Field ValueThe names of the fields and their values to use when creating/updating a record.
Dynamic Values
Connection