Microsoft Dynamics 365

Get Dynamics 365 Access Token

Gets the access token the other Dynamics 365 tools need. The bot calls this first.

Unverified

What the model is told

Get an access token for Dynamics 365 (Dataverse). Call this once before any other Dynamics 365 tool, then pass the access_token value from the response to those tools. Never read the token aloud or share it with the customer. If a Dynamics 365 tool returns a 401, call this again to get a fresh token.

Request

POSThttps://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/token

Headers

  • Content-Typeapplication/x-www-form-urlencoded

Body

grant_type=client_credentials&client_id=YOUR_DYNAMICS_CLIENT_ID&client_secret=YOUR_DYNAMICS_CLIENT_SECRET&scope=https://YOUR_ORG.crm.dynamics.com/.default

Parameters

None.

Engage payload

{
  "source": "VOICE_AI",
  "tool": {
    "id": "a6985399-6110-4f81-8a61-cd0df5ece111",
    "type": "HTTP_REQUEST",
    "label": "Get Dynamics 365 Access Token",
    "name": "get_dynamics_365_access_token",
    "customName": false,
    "description": "Get an access token for Dynamics 365 (Dataverse). Call this once before any other Dynamics 365 tool, then pass the access_token value from the response to those tools. Never read the token aloud or share it with the customer. If a Dynamics 365 tool returns a 401, call this again to get a fresh token.",
    "parameters": [],
    "config": {
      "endpoint": {
        "method": "POST",
        "url": "https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/token"
      },
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/x-www-form-urlencoded"
        }
      ],
      "body": "grant_type=client_credentials&client_id=YOUR_DYNAMICS_CLIENT_ID&client_secret=YOUR_DYNAMICS_CLIENT_SECRET&scope=https://YOUR_ORG.crm.dynamics.com/.default",
      "timeout": null
    }
  }
}

IDs are regenerated on every copy.