Monday, June 27, 2022

D365 Finance & Operation Web Service with POST MAN

 

Dynamics 365 Finance & Operation WebAPI with POST MAN


Dynamics 365 Finance & Operation WebAPI with POSTMAN


Most of the time we used 3rd Party tools like fiddler, Post Man and SoupUI as clients to consume web services.

In this blog i will explain, How can we use POSTMAN to consume Web-API by using Oauth2 Azure Authentication.


1 Download the POSTMAN from this link.

2 Register The Azure Application (Web API). You can follow this link
 
3 Once App registration completed Enter Application ID in D365FO










4 Open POST man and navigate to Authorization Tab and select OAuth2 as Authentication Type.

Reference screenshot





5 Click on Get New Access Token. A Popup will appear.








6 Fill the required fields Like below

Call Back URL > You can't change this.
Token Name (As per your requirement)
Auth URL

https://login.windows.net/YourTenant.com/oauth2/authorize?resource=https://EnvironmentURL.operations.dynamics.com

Access Token URL
https://login.windows.net/YourTenant.com/oauth2/token?resource=https://EnvironmentURL.operations.dynamics.com

You can find the tenant from AX as well. Open D365FO Click on the Setting icon. you can find it the on the top right of the screen then click on about.







Client ID > Application ID You Registered On Azure Portal
Secret Key > Enter the secret key you generate against your Azure Application.







7 If you don't provide a secret key then a popup window will appear for login.


 



8 Click on Request Toke. Within 4 to 5 seconds you will get the Azure Authentication Token.

9  Now select the Header value from the drop-down and click on USE token to add this token in your request.




10 Navigate to Header Tabs for the verification of the Authorization token in your request



11- Enter the Complete service URL and click on send. in my case, I have called test2 service.

Service URL 
https://usnconeboxax1aos.cloud.onebox.dynamics.com/api/services/[ServiceGroupName]/[ServiceName]/[MethodName]

Sample
https://usnconeboxax1aos.cloud.onebox.dynamics.com/api/services/IntegrationGroup/IntegrationService/test2 





Please check the above screenshot. You will find the successful result 

No comments:

Post a Comment