missing or unknown grant type

Hi dears, I met the issue getting access token. It works fine on postman, but I get error on MS Power Automate.

My request is below, really appreciate your help.

HTTP call on Power Automate

{

“uri”: “https://api.hubapi.com/oauth/v1/token?grant_type=refresh_token&client_id=XXX&client_secret=YYY&redirect_uri=https://www.msapp.pro/auth-callback/&refresh_token=ZZZ”,

“method”: “POST”,

“headers”: {

“Content-Type”: “application/x-www-form-urlencoded;charset=utf-8”

}

}

@himanshurauthan

Any chance you could help out here?

Hello, @dennisedson sure I would love to give it a shot!

So @TSDev try to send the grant_type, client_id, and other parameters in the body instead of in uri like this:

{

 "uri": "https://api.hubapi.com/oauth/v1/token",

 "method": "POST",

 "headers": {

 "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"

 },

 "body": "grant_type=refresh_token&client_id=XXX&client_secret=YYY&redir..."

}

Hope this will fix the issue.

Best regards,

Hi @himanshurauthan thank you for your quick reply. That syntaxis works on Power Automate (but shouldn’t :slightly_smiling_face: ) and doesn’t work on Postman, so it’s good for me.

"body": "grant_type=refresh_token&client_id=XXX&client_secret=YYY&redir..."

The odd thing is it doesn’t work when I use key pairs, like key:value and I think there is a room for API improovement :slightly_smiling_face:

But any way, my issue has been solved, thanks a lot.

Slava.

Great to hear that the solution worked for you.

For getting the access token send the values as query string in the body instead of key:value.