# missing or unknown grant type

**URL:** <https://community.hubspot.com/t/missing-or-unknown-grant-type/49011>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [December 28, 2021, 11:35am UTC](https://community.hubspot.com/t/missing-or-unknown-grant-type/49011 "2021-12-28T11:35:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TSDev](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@TSDev](https://community.hubspot.com/u/TSDev)\
**Post date:** [December 28, 2021, 11:35am UTC](https://community.hubspot.com/t/missing-or-unknown-grant-type/49011/1 "2021-12-28T11:35:48Z")

</div>

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](https://www.screencast.com/t/fgEfcgPMh)

{

“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](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”

}

}

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [January 3, 2022, 4:46pm UTC](https://community.hubspot.com/t/missing-or-unknown-grant-type/49011/2 "2022-01-03T16:46:00Z")

</div>

@himanshurauthan

Any chance you could help out here?

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [January 4, 2022, 10:28am UTC](https://community.hubspot.com/t/missing-or-unknown-grant-type/49011/3 "2022-01-04T10:28:32Z")

</div>

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:

```lia-code-sample
{

 "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,

---

<div class="post-metadata">

**Author:** ![TSDev](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@TSDev](https://community.hubspot.com/u/TSDev)\
**Post date:** [January 4, 2022, 5:49pm UTC](https://community.hubspot.com/t/missing-or-unknown-grant-type/49011/4 "2022-01-04T17:49:52Z")

</div>

Hi @himanshurauthan thank you for your quick reply. That syntaxis works on Power Automate (but shouldn’t 🙂 ) 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 🙂

 ![HSTokenIssue.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/4/e4f77f1967eef2624964524b098290d49e57ff60.png)

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

Slava.

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [January 5, 2022, 7:55am UTC](https://community.hubspot.com/t/missing-or-unknown-grant-type/49011/5 "2022-01-05T07:55:30Z")

</div>

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**.
