Connect with an on-premises environment
- Launch the Postman desktop application.
- Select the Environment Options gear icon in the top-right corner.
- In the Manage Environments dialog box, select the Add button to add a new environment.
- In the dialog box that opens, add a name for the environment. Then copy the following key-value pairs into the editing space.
Variable Name | Value |
---|---|
url | http://yourservername/yourorgname |
version | 9.0 |
webapiurl | {{url}}/api/data/v{{version}}/ |
- Replace the instance URL placeholder value with your Dynamics 365 for Customer Engagement apps instance URL, and select Add to save the environment.
- Close the Manage environments dialog box.
Set credentials
- On the Authorization tab, select NTLM Authentication [Beta].
- Set the following values in the form:
• Username. Type the alias only; do not include the domain.
• Password. You have the option to show the password.
• Domain. You must set this if you are accessing the account from a different domain, although you can set it to ~ so that the default domain of the server is used.
Your authentication might look like this if you are logging in as an administrator.
Test your connection
Create a new Web API request to test the connection with your Dynamics 365 for Customer Engagement apps instance. Use the WhoAmI function:
- Select
GET
as the HTTP method and add{{webapiurl}}WhoAmI
in the editing space. - Select Send to send this request.
- If your request is successful, you see the data from the WhoAmIResponse ComplexType that is returned by the WhoAmI Function.
Connect with your Common Data Service environment
This environment uses a client ID for an application that is registered for all Common Data Service environments.
You can use the clientid
and callback
values supplied in these instructions. However, when building your own application, you should register your own Azure Active Directory (Azure AD) application.
To register your own Azure AD application, see the steps described in Walkthrough: Register a Common Data Service app with Azure Active Directory.
Use these steps to create a Postman environment that you can use to connect with your Common Data Service instance:
- Launch the Postman desktop application.
- Select the Environment Options gear icon in the top-right corner.
- In the Manage Environments dialog box, select the Add button to add a new environment.
-
In the dialog box that opens, type a name for the environment. Then add the following key-value pairs into the editing space.
Variable name Value url
https://<add your environment name, like ‘myorg.crm’>.dynamics.com
clientid
51f81489-12ee-4a9e-aaae-a2591f45987d
version
9.0
webapiurl
{{url}}/api/data/v{{version}}/
callback
https://callbackurl
authurl
https://login.microsoftonline.com/common/oauth2/authorize?resource={{url}}
-
Replace the instance URL placeholder value with the URL of your Common Data Service instance, and select Add to save the environment.
-
Close the Manage environments dialog box.
Generate an access token to use with your environment
To connect using OAuth 2.0, you must have an access token. Use the following steps to get a new access token:
-
Make sure the new environment you created is selected.
-
Select the Authorization tab.
-
Set the Type to OAuth 2.0.
-
Verify that you have selected the environment that you created.
-
Select Get New Access Token
-
Set the following values in the dialog box. Select
Implicit
from the Grant Type drop-down menu. You can set the Token Name to whatever you like, and leave other keys set to default values.Note
If you are configuring environments in Postman for multiple Common Data Service instances using different user credentials, you might need to delete the cookies cached by Postman. Select the Cookies link, which can be found under the Send button, and remove the saved cookies from the Manage Cookies dialog box.
Some of these cookies are very persistent. You can delete some of them in groups, but you might have to delete others individually. You might need to do this twice to ensure that no cookies remain. -
Select Request Token. When you do this, an Azure Active Directory sign-in page appears. Enter your username and password.
-
After the token is generated, scroll to the bottom and select Use Token. This closes the Manage Access Tokens dialog box.
-
After you have added a token, you can select which token to apply to requests. On the Available Tokens drop-down list, select the token you have just created. The Authorization header gets added to the Web API request.
See Test your connection for steps to verify your connection.
Test your connection
Create a new Web API request to test the connection with your Common Data Service instance. Use the WhoAmI function:
- Select
GET
as the HTTP method and add{{webapiurl}}WhoAmI
in the editing space. - Select Send to send this request.
- If your request is successful, you see the data from the WhoAmIResponse ComplexType that is returned by the WhoAmI Function.