Tuesday, 23 May 2017

Dynamics 365 for Operation Web Service calls with POSTMAN

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

image

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

image

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*****

image

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.

image

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.

image

No comments: