Wednesday, November 23, 2022

How to use Postman with Dynamics 365 FO

 To use postman in Dynamics basically, we need to follow 2 steps:

1. Register the app in the Azure portal.

How to register Azure app for Dynamics 365 FO


2. Connection with the postman :

Download and install postman from the following link: Download

Open postman and click on new


A new popup window will open, select "Collections"


Name it as per your needs, in my case, I am renaming as "Dynamics 365 F&O"

Now click on Type and select OAuth 2.0


A new form will pop up, fill in the following information


Callback URL: Dynamics 365 F&O URL
Auth URL: https://login.microsoftonline.com/common/oauth2/authorize?resource=https://its-dev01XXXXXXXXXXXXXXXXdevaos.axcloud.dynamics.com/
{
Auth URL = A + B
where A: https://login.microsoftonline.com/common/oauth2/authorize?resource=
and B: Dynamics 365 F&O URL
}
Access token URL: You may take from the azure app you just created in the First step
Client ID: eXXXXXX7-XXXX-YYYY-ZZZZ-476XXXXXXX23
Client ID will be the Application ID from the Azure portal


Now click on "Get new access token"
It should ask for your credentials, fill in the details and an access token will be generated, like below





Click on "Use Token"
Now click on "Add a request"


Now a new form will open like below


Now we are testing using a "GET" request for the Customer group data entity
Fill in the mentioned area like in the below picture, and replace {{URL}} with your Dynamics 365 F&O URL


Now click "Send". You will get the data like below



Now for the "POST" request, select the "Post" like below


Now go to "Headers" and create new content-Type = application/json



Now go to Body, select raw, and then select Text, put in the data that we want to send to dynamics 365 F&O, and click "Send"


Data sent to Dynamics 365 F&O


Tada!!!