Setup Postman To Call D365fo API

Prerequisites

  • Install Postman on the local development VM.
  • Go to https://portal.azure.com
  • Select "Azure Active Directory"
  • Write the "Tenant ID". We will use it later with name "Directory ID"


  • Select "App registrations" then click "+ New registration" and fill data as following and press Register:
  • Write the "Application (client) ID". We will use in later with name "Client ID"

  • Select "Certificates & secrets" then click the "+ New client secret".
  • Fill Description and Expires then click "Add".

  • Write the "Value". We will use it later with name "Client secret ID"
  • Login to D365fo then go to System administration then Setup then Azure Active Directory applications.
  • Click New then fill the "Client ID" with the "Application Client (ID)" then fill "Name" then fill "User ID", for testing select user with system administrator privileges then click Save.

Create request in Postman to get token

  • Create new Request in Postman and change type to Post
  • Use the following URL: 
    • https://login.microsoftonline.com/<Directory ID>/oauth2/v2.0/token
    • Replace the <Directory ID> with your "Tenant ID".
  • Select "Headers" tab and fill the following Keys.

  • Select "Body" tab and fill the following Keys.

  • When click "Send" button. You will see the result as the following:

Save the token in your Postman environment variables

  • In "Environments" Tab select your environment then add variable as following:

  • In token request select "Tests" tab and fill the following code.
var tokenData = JSON.parse(responseBody);
postman.setEnvironmentVariable("d365fo_token"tokenData.access_token);




  • Click Save then Send. The token will be saved in "d365fo_token" variable.

How to call D365fo API?

  • Create new Request in Postman.
  • Use the following URL (For example): 
    • https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/Vendors
  • Select "Headers" tab and fill the following Keys.
  • Click Save then click Send.


Comments

Popular posts from this blog

How to loop through enum in dynamics ax 2012 using x++

How to read from csv file in Dynamics AX 2012 Through X++

How to Create Transfer Journal in Dynamics AX 2012 Through X++