Power Community

Power Community

Setting up Postman Environment to test the Dataverse API’s – Quick Tip

https://ecellorscrm.files.wordpress.com/2023/02/postman-dataverse-1.png

Hi Folks,

Today in this blog post, I would like to share how we can quickly set up Postman Environment to test out the Dataverse API’s right away. It’s very easy and doesn’t need any Client Id, Client Secret registration in Azure AD for Authorization if you follow these steps as the provided Client id works for all Dataverse environments, so let me take you through.

You just need to have a Dataverse environment that you can connect to and Postman desktop App in your machine(Preferably windows)

  1. Lauch the Postman desktop application
  2. Create the environment by click

3. Enter a name for your environment, for example, Blog Environment as below

4. Get the Web API end point URL for your environment with few simple steps as below…by going to Developer resources in make.powerapps.com

Then copy the Web API endpoint URL as below…

Next step is to add following key value pairs in Postman for connecting to Dynamics..please make sure you use the same clientid(51f81489-12ee-4a9e-aaae-a2591f45987d), it is the same to connect to any Dataverse environment.

Your updated configuration should look something as below in the Postman.

Click on save to save your newly created environment as highlighted below..

Now all you need is to generate access token in order to authenticate with your Dataverse environment to connect using OAuth 2.0

Follow the simple steps below..

Click on newly created environment, click on + symbol besides it as highlighted below

The following pane appears. Select the Authorization tab.

Set the Type to OAuth 2.0 and set Add authorization data to to Request Headers, if you scroll down a bit, you will be able to see Configure New Token option as below, else you wouldn’t.Auth request headers

In the Configure New Token pane, set the following values:

NameValueAction
Grant TypeimplicitChoose implicit from the drop-down
Callback URL{{callback}}Copy the value
Auth URL{{authurl}}Copy the value
Client ID{{clientid}}Copy the value

The settings should appear as below

Tip: If you were using the Postman to connect to multiple dataverse instances, make sure you clear your Cookies inorder delete the cookies in Postman.

Click on Get New Access Token button, within a moment, you should see a Azure Active Directory pop up to Authenticate your login from browser.

Click Get New Access Token.Once you click Get New Access Token, an Azure Active Directory sign-in dialog box appears. Enter your username and password, and then click Sign In. Once authentication completes, the following dialogue appears and just get the token with few more steps as below.

  1. Authentication completes
  2. After the authentication dialogue automatically closes in a few seconds, the Manage Access Tokens pane appears. Click Use Token.Access token page
  3. The newly generated token will automatically appear in the text box below the Available Tokens drop-down.Token autopopulate

Test your connection

The following shows how to test your connection using WhoAmI:

  1. Select GET as the HTTP method and add {{webapiurl}}WhoAmI in the editing space.Calling WhoAmI endpoint
  2. Click Send to send this request.
  3. If your request is successful, you will see the data returning from the WhoAmI endpoint, like below:Response from WhoAmI

Hope you have found this post useful…when you were working with Dataverse API’s.

Cheers,

PMDY

Advertisement

Author: Pavan Mani Deep Y

Technology geek who loves sharing my leanings, quick tips and new features on Dynamics 365 & related tools, technologies. An Azure IOT Enthusiast….

This post was originally published on this site

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement - Advertisement

Latest News

ON DEMAND | SharePoint in-depth: Learning content

There’s the thinking cap. And then there’s the deep-thinking cap. It’s time to put on the latter. This article contains...

More Articles Like This

- Advertisement -spot_img