Skip to main content
The Dynamics365ResourceClient allows you to connect to Microsoft Dynamics 365 (Dataverse) and interact with CRM data including accounts, contacts, opportunities, and custom entities.

Usage

import { myDynamicsClient } from "./clients";

const result = await myDynamicsClient.invoke(
  "GET",
  "/api/data/v9.2/accounts",
  "list-accounts",
  {
    query: { $top: "50" },
  }
);

if (result.ok && result.result.body.kind === "json") {
  console.log("Accounts:", result.result.body.value);
}

Authentication

When creating a Dynamics 365 connector, you need to provide:
  1. Instance URL — your organization’s Dataverse endpoint (e.g., https://myorg.crm.dynamics.com)
  2. OAuth Scope — choose your access level:
    • Read-only — query Dataverse entities without modification
    • Read-write — query and update Dataverse data
    • Custom — configure specific permissions manually
The OAuth flow redirects to Microsoft to authenticate your account. Major securely stores the token and handles authentication for all API requests.

Inputs

The invoke method accepts the following arguments:
method
string
required
The HTTP method to use: "GET", "POST", "PATCH", or "DELETE".
path
string
required
The Dataverse Web API path (e.g., /api/data/v9.2/accounts, /api/data/v9.2/contacts).
invocationKey
string
required
A unique identifier for this operation.
options
object
Optional configuration object.

Outputs

The output format is the same as the Custom API client.
kind
"api"
Discriminator for the response type.
status
number
The HTTP status code.
body
ResponseBody
The response body (typically JSON).