Skip to main content

Microsoft Dynamics 365 Component

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

Component key: ms-dynamics

Description

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

MS Dynamics 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 in Prismatic

Within Prismatic, 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

MS Dynamics OAuth 2.0 Auth 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.prismatic.io/callback
    • Click Register
  4. Under API permissions click +Add a permission
    • Select Dynamics CRM
    • Check the user_impersonation permission
    • Click Add permissions
  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

Within Prismatic, 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

Triggers

Webhook

Receive and validate webhook requests from Microsoft Dynamics for webhooks you configure. | key: dynamicsWebhookTrigger


Data Sources

[CRM] Entity Object Selection

A subset of Dynamics CRM Entity Types. | key: getEntitiesMetaData | type: objectSelection


Actions

[CRM] Batch Entity Actions

Perform multiple create/update/delete actions on Microsoft Dynamics 365 CRM entity records. | key: batchEntityActions


[CRM] Create Attribute

Create a CRM Attribute on an Entity | key: createAttribute


[CRM] Create Entity

Create a new Microsoft Dynamics 365 CRM entity record. | key: createEntity


[CRM] Delete Entity

Delete the specified Microsoft Dynamics 365 CRM entity record. | key: deleteEntity


[CRM] Get Attribute

Retrieve a single CRM Attribute | key: getAttribute


[CRM] Get Current User

Get information about the currently logged in CRM user | key: getCurrentUser

Output Example Payload

{
"data": {
"@odata.context": "https://my-org.crm.dynamics.com/api/data/v9.1/$metadata#Microsoft.Dynamics.CRM.WhoAmIResponse",
"BusinessUnitId": "00000000-0000-0000-0000-000000000000",
"UserId": "00000000-0000-0000-0000-000000000000",
"OrganizationId": "00000000-0000-0000-0000-000000000000"
}
}

[CRM] Get Entities Metadata

A subset of Dynamics CRM Entity Types. | key: getEntitiesMetaData


[CRM] Get Entity

Retrieve a single Microsoft Dynamics 365 CRM entity record. | key: getEntity


[CRM] Get Entity Metadata

Get definition of Microsoft Dynamics 365 CRM entity. | key: getEntityMetaData


[CRM] Query Attributes

Query for CRM Attributes that satisfy the filter expression | key: queryAttributes


[CRM] Query Entities

Query for Microsoft Dynamics 365 CRM entity records that satisfy the filter expression. | key: queryEntities


[CRM] Raw Request

Send raw HTTP request to Microsoft Dynamics 365 CRM | key: rawRequest


[CRM] Run Fetch XML Query

Execute a fetch XML query against your Microsoft Dynamics 365 CRM instance. | key: fetchXml


[CRM] Update Attribute

Update an existing CRM Attribute on an Entity | key: updateAttribute


[CRM] Update Entity

Update a Microsoft Dynamics 365 CRM entity record. | key: updateEntity


[CRM] Upsert Entity

Upsert a Microsoft Dynamics 365 CRM entity record. | key: upsertEntity


Raw Request

Send raw HTTP request to Microsoft Dynamics 365 | key: rawRequestV2