The request body must contain the following parameter: 'grant_type'
// Line breaks are for legibility only.
POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token HTTP/1.1
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
client_id=535fb089-9ff3-47b6-9bfb-4f1264799865
&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default
&client_secret=qWgdYAmab0YSkuL1qKv5bPX
&grant_type=client_credentials
The endpoint is returning an error.
Do people look at the instructions they post and actually think to themselves if they make sense and if they really would work if someone tried to use them?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Works fine for me. What error are you getting?
@jasonjoh can you give your example postman or curl your using exactly minus your credentials.
this is a part of the error output. it just gives that all of the time.
The request body must contain the following parameter: 'grant_type'
Ok, that's odd. The included request in the docs has grant_type=client_credentials. That error tells me either however you're sending it left it out, or you maybe didn't send it as application/x-www-form-urlencoded?
I used Postman, there's an included token request for app-only token in our Graph Postman collection.

@jasonjoh Where did you get the clientID and ClientSecret From. Just double checking that exactly.
I registered an application in the Azure portal. This is mentioned in step 1.
@jasonjoh that was it. Thank you sir. Also, lol, that x-www-form urlencoded is not perhaps the most commonly used param body. Was that in the docs?
Most helpful comment
Ok, that's odd. The included request in the docs has
grant_type=client_credentials. That error tells me either however you're sending it left it out, or you maybe didn't send it asapplication/x-www-form-urlencoded?I used Postman, there's an included token request for app-only token in our Graph Postman collection.