Recently I wanted to test some APIs against the Microsoft Dynamics platform. And one of the things I wondered is how to authenticate against Microsoft Dynamics. In other words, what is the best way to get and use an Access Token.
Set up Environment in Postman
The easiest way is to first create a new environment for this in Postman. Let’s call our environment “Microsoft Dynamics”.

Get the Web API endpoint host
Before we continue, we need to know the Host of our dynamics web API endpoint. I obtained this by clicking on the gear wheel via Power Apps, then on ‘Developer resources’.

Then you get the Web API endpoint, but remember, we just need the host:

Setting up the variables
Next we need to create some variables needed to authenticate against Dynamics:
- url: this is the wep API endpoint host
- clientid: 51f81489-12ee-4a9e-aaae-a2591f45987d. This is a reserved guid in Azure AD.
- version: 9.2. This is the api version we want to use
- webapiurl: {{url}}/api/data/v{{version}}/
- callback: https://localhost
- authurl: https://login.microsoftonline.com/common/oauth2/authorize?resource={{url}}

Setting up the Authorization of our request
Now we are going to create a new request. With the new request you go to the Authorization tab and you select “OAuth 2.0” as type. As “add authorization data to”, you can select “Request Headers”

Next we have to configure the options as below, finally you can click on “Get New Access Token”.

You will see a prompt asking you to log in. Once successfully logged in you will see the following screen:

After you click on proceed, you can click on “Use Token”

Finally, we can perform our request and start testing many more api’s against Microsoft Dynamics!
