Wednesday 3 July 2019

How to use post man with Dynamics CRM 365

With Dynamics 365, Web API use become quite popular and also Microsoft promoting Web API more than other CRUD operation method.
So, sometime we need to execute our web API queries to test or build in JS or HTML web resource or other places.

For this Postman is a great tool to execute or Test our Web API.

In this blog I will try to explain how we can use Postman with Dynamics CRM 365.

 1. Download and Install Postman in your local system. (Download)

 

2. Open Postman and create click on environment to create new environment.














3. Enter Name and add variables to use in later queries.



















Sample Data:-
Name- Demo CRM

Variable
Initial Value
Current Value
url
https://crmorg.crm8.dynamics.com
https://crmorg.crm8.dynamics.com
version
9.1
9.1
webapiurl
{{url}}/api/data/v{{version}}/
{{url}}/api/data/v{{version}}/
Token
Enter token value
Enter token value

4. To get Token Open (http://xrm.tools/) and Sign In with CRM credentials. You also need to accept Consent.

5. Click on "Access Token" link from right side menu.

 Select your organization and click on "Copy to clipboard".









Add copied Token in Postman your environment variable(Token).

6. Create New Collection.





























Go to “Authorization” tab.
Select Type->Bearer Token
Enter {{Token}} variable in token.




6. Create New Request and Select your collection.



    Below are the request we can use in Postman.

1. Retrieve Multiple:-






Select “Get” method.

        Enter “{{webapiurl}}/entity plural name” and click on Send button.

2. Using FetchXML



Select “Get” method.
       Enter “{{webapiurl}}/entity plural name”fetchXml=your fetchxml query” and click on Send button.

3. Delete Record



Select “DELETE” method.
      Enter “{{webapiurl}}/entity plural name(Entity record Guid)” and click on Send button.    


4. Update










Select “PATCH” method.
Enter {{webapiurl}}/entity plural name(Entity record Guid)”

Select Body Tab(Json(application/json)
Enter your information. 
       Click on Send button

5. Create


Select “POST” method.
Enter “{{webapiurl}}/entity plural name”
Select Body Tab(Json(application/json)
Enter your information. 
       Click on Send button.

You can use below reference to get more information on Postman operations:-



Share your feedback and follow blog to be updated !!















No comments:

Post a Comment

Field Security Profile - Based on Owner

 Recently received requirement related to Field security profile. Expectation : - 1.       Set to users need access of secure attributes. 2....

Test