Wednesday, 14 October 2020

Configure postman to test D365FO custom or Odata services

Hi Folks,

I will describe the steps to configure Postman app to test D365 FO services.

Step 1: Download postman application and install in your laptop or server. You can download it from https://www.postman.com site.

Step 2: Install the application and open it

Step 3: Configure an environment.

click on new button.


select environment 

Enter a environment name and add variable as mentioned in below screen. I hope you have client id, tenant id, secret key, F&O url. If you don't have this then check with your admin and get it, You need to enter F&O url in resource variable.

Step 4: Configure collection.
Add a new collection by clicking on New collection button


Step 5: Add new request by right clicking over collection


Step 6: Add new request by right clicking over collection
Provide a name (OAuth) and add authentication url 
(https://login.microsoftonline.com/86e72e20-c42b-4288-bb5d-b5f831760843/oauth2/token) and method as Post




 

go to Body tab and add variable as below:

Now go to test tab and paste below script there

var json = JSON.parse(responseBody);
tests["Get Azure AD Token"= !json.error && responseBody !== '' && responseBody !== '{}' && json.access_token !== '';
postman.setEnvironmentVariable("bearerToken"json.access_token);







click on send button. It will create a secure connection and update the bearerToken.
This bearerToken has some expiry time as well so it may expire in 10-15 mins.

Step 8: Now you add new requests (step 5) to check you web services.
In url section, put your customer service url, In body paste your JSON format input value









In Header tab, add keys and values as per below screen










Click on send button and you will receive response from your web service as below:














Similerly you can configure your customer or Odata service and test it.

No comments:

Post a Comment

D365FO Entity insert/update issue Update not allowed for field ‘Entity.FieldName’.

Step 1: Make sure fields properties allow edit is yes in Data entity level(In Table level Allow edit is No). Change to Yes in entity fields ...