Testing Dynamics 365 Finance and Operations API via Postman

  1. Download Postman from its official site.
  2. Sign in or create a free account. Select the free plan if you don’t have a subscription.
  3. Create a new collection and rename it to your Dynamics 365 Finance and Operations project name. file
  4. Inside the collection, go to ScriptsPre-request and paste the JavaScript code. file
var app_id = pm.variables.get("clientId");
var app_key = pm.variables.get("secret");
var authurl = pm.variables.get("tenant") + "/oauth2/token";
var resource = pm.variables.get("resource");

pm.sendRequest({
    url: authurl,
    method: 'POST',
    header: {
        'content-type': 'application/json'
    },
    body: {
        mode: 'urlencoded',
        urlencoded: [
            {key: "grant_type", value: "client_credentials", disabled: false},
            {key: "client_id", value: app_id, disabled: false},
            {key: "client_secret", value: app_key, disabled: false},
            {key: "resource", value: resource, disabled: false}
            ]
    }
}, function (err, res) {
     pm.variables.set("token", res.json().access_token);
});
  1. Under the Authorization tab, choose: Auth Type: Bearer Token Token: {{token}} file

  2. Save the collection settings.

  3. In Environments, create a new environment and define:

  • clientId (your Azure AD application client ID)
  • secret (your Azure AD app secret)
  • tenant (your tenant’s OAuth2 endpoint base URL)
  • resource (the target Dynamics 365 resource URL)

file

  1. Save the environment.
  2. Create a new POST request, select this environment, and hit Send.

file

Was this article helpful? Votes: 0
Article details:
Published date: 16/06/2025 10:25AM
Last updated: 16/06/2025 12:38PM (LS Mark)
Share article: 
Author: LS Mark
Permalink: https://doc.daxonet.com/kb/500735