问题
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 ...
- Consumer Key
- Consumer Secret
- Redirect Uri
- Authorize Redirect URL
- HTTP Method = POST
- 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).
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.
回答1:
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:
Use OAuth 2.0
in Authorization
tab, and Get New Access Token
.
来源:https://stackoverflow.com/questions/60192150/accessing-dynamics-365-api-using-postman