January 14, 2019 · Dataverse SDK · 1 min read · apurvghai · Postman, General
Postman is the most popular tool today to troubleshoot and write sample code for testing. Postman offers variety of programming options as well. I love to use variables option which is easy to then show the data.
There are different ways to use Postman with Online vs OnPremise system
Setup Postman
Prerequisites
Instructions
Follow these instructions to Post x-www-form-urlencoded
. You can use the below parameters
Online: POST https://login.microsoftonline.com/your-azure-tenantid/oauth2/token
OnPremise/IFD: POST https://yourstsurl.yourdomain.com/adfs/ls
Server to Server authentication
grant_type: client_credentials
client_id: {client_id}
client_secret: {client_secret}
resource: {resourceurl}
User Password authentication
grant_type: password
client_id: {client id}
client_secret: {client_secret}
resource: {resourceurl}
username: {username}
password: {password}
Navigate to Tests tab, paste below code:
var json = JSON.parse(responseBody);
postman.setEnvironmentVariable("BearerToken", json.access_token);
On-Premise Approach
OnPremise approach differs but not a lot. Your token URL is now ADFS Url and resource URL becomes your CRM org’s IFD url.
Example: resource: https://yourCRMorg.yourdomain.com
This will return JWT Token which can be decoded from this site and will be stored in your variables.
Important Note Create application user in CRM Online. Follow these instructions
CRM WebAPI Operations
Now that you know how to perform POST or GET Operations. I will now demostrate how to use JWT token and make CRM Web API.
Authorization: Bearer {BearerToken}
Hit send and enjoy your results
Getting started with Dynamics 365 CRM SDK in C#
Jan 14, 19 by apurvghai
Using Postman with Dynamics 365 Online and OnPremise
Jan 14, 19 by apurvghai
Getting Started with WebAPI
Dec 28, 18 by apurvghai
Dynamics 365 – WebAPI CRUD Operations (C#)
Jul 04, 17 by apurvghai