Tuesday, 23 May 2017

Dynamics 365 for Operation Web Service calls with POSTMAN

UPDATE: 28 June 2018 - Follow this post http://dynamicsnavax.blogspot.com/2018/06/testing-msdyn365fo-odata-with-postman.html

I am going to leave the below for history but it is no longer valid.

In this post I will explain using POSTMAN but it really doesn’t matter what tool you use (SOAPUI is another common tool). The main point I am trying to make is how to put the authentication piece together so you can start messaging to/from the web service.

Download POSTMAN from their site https://www.getpostman.com/

In Azure AD register the application. For more info see previous post I wrote http://dynamicsnavax.blogspot.com.au/2016/09/azure-ad-in-new-portal.html

For POSTMAN, you need to enter the redirect. POSTMAN would tell you this later when you try to get a token.

Redirect URL: https://www.getpostman.com/oauth2/callback


Open up POSTMAN and enter your URL you want to send a request to. Click on the bright orange button “Get New Access Token”


This dialog will pop up. It will ask for a bit of info:

  1. Auth URL – You can enter the following. Replace the tenant and the resource url https://login.windows.net/mytenant.onmicrosoft.com/oauth2/authorize?resource=https%3A%2F%notarealurl1adaos.cloudax.dynamics.com
  2. Access Token URL – same thing replace the tenant and the resource url – https://login.windows.net/mytenant.onmicrosoft.com/oauth2/token?resource=https%3A%2F%notarealurl1adaos.cloudax.dynamics.com
  3. Client ID – Get the Application ID from Azure 2 screenshots above. Mine starts with b87bf*****


When you click on the request, it will pop up with the login window. If you supply a Client Secret key it won’t.

You should get a response and then you can click on “Use Token” button. It will insert it into the header of the message.


You can now enter your parameters if you wish. Nice interface to play with. It will build up your URL for you. Then click on Send button.

Result should show in the body.



Stanza said...
This comment has been removed by the author.
Anonymous said...

can you brief about resource? What is it?

Martin DrĂ¡b said...

There is an error in URLs. It should be ?resource=https%3A%2F%2Fnotarealurl1adaos.cloudax.dynamics.com instead of ?resource=https%3A%2F%notarealurl1adaos.cloudax.dynamics.com ('://' is encoded to %3A%2F%2F, not to %3A%2F%).

Munib Ahmed said...

Thanks Martin. I didn't even notice that.