Search code examples
apidynamics-crmpostmandynamics-365dynamics-crm-webapi

Accessing Dynamics 365 API using Postman


I am trying to make an API request against a Dynamics 365 API account using Postman. I have the following credentials but I do not know what headers to use to authenticate.

I have the following ...

  1. Consumer Key
  2. Consumer Secret
  3. Redirect Uri
  4. Authorize Redirect URL
  5. HTTP Method = POST
  6. Access Token Service Endpoint

What headers do I need to set in Postman to get access to the API?

I have read articles and seen some examples but they all have different data than I do. For example in the screen capture below there is a username and password in addition to a Consumer Key (client_id) and Consumer Secret (client_secret).

enter image description here

I do understand that I need to obtain a Bearer token first before making the API call. It is obtaining this token that is confusing me.


Solution

  • Simply follow this documentation to setup the Postman for Dynamics web API, even the ready-made clientid = 51f81489-12ee-4a9e-aaae-a2591f45987d will work for any CRM online instance for testing purpose. You can use your customer provided clientid as well.

    url should be https://crmdev.crm.dynamics.com
    authurl should be https://login.microsoftonline.com/common/oauth2/authorize?resource={{url}}

    First create an environment in Postman:

    enter image description here

    Use OAuth 2.0 in Authorization tab, and Get New Access Token.

    enter image description here