Reputation: 13
I am trying to get access token using microsoft graph api via postman. I have provided client id and client secret (please refer to the attached screenshot). I am getting http 404 not found error. I am using following endpoint for fetching access token.
https://login.microsoftonline.com/{{TenantID}}/oauth2/v2.0/token
I trying write a function that will fetch the access token and then I will making another function call which will files from a sharepoint folder.
Upvotes: 0
Views: 691
Reputation: 1078
You can follow the first part of this article from Microsoft Learn.
Are you sure you set Content-Type
to application/x-www-form-urlencoded
in the headers?
https://login.microsoftonline.com/<TENANT ID>/oauth2/token
(2)Headers tab
(3) add Content-Type
key and application/x-www-form-urlencoded
for the value (4)Body tab
, and add the following keys and values.
form-data
grant_type
key, and type client_credentials
for the value.client_id
key, and paste the value of client ID
you noted down earlier.client_secret
key, and paste the value of client secret you noted down earlier.Send
to send the request to get the tokenUpvotes: 1