# Keep getting unsupported\_grant\_type

**URL:** https://www.patreondevelopers.com/t/keep-getting-unsupported-grant-type/4379
**Category:** Docs Feedback
**Created:** [April 7, 2021, 8:44pm UTC](https://www.patreondevelopers.com/t/keep-getting-unsupported-grant-type/4379 "2021-04-07T20:44:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DS-Studio](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@DS-Studio](https://www.patreondevelopers.com/u/DS-Studio)
#### Post date: [April 7, 2021, 8:44pm UTC](https://www.patreondevelopers.com/t/keep-getting-unsupported-grant-type/4379/1 "2021-04-07T20:44:22Z")

</div>

I am trying to get user access token, i did created my own html page on the redirect url.  
When i get the code i pass it to cloud code (Sashido/Parse) and i will call post from there, but i keep getting unsupported\_grant\_type.  
I tested it on PostMan and everythings works perfectly, so i guess it’s something related to cloud and/or Sashido server.

I did a lot of try, the code i am going to show is not my first attempt.  
Just a small note, i am a c++ programmer not really used to program in nodejs, so be friendly with me 🙂

> ```
> let patreonCheck = {
> code: patreonCode,
> grant_type: 'authorization_code',
> client_id: 'MY_CLIENT',
> client_secret: 'MY_SECRET',
> redirect_uri: 'https://www.ds-studio-dev.com/checkUser.html'
> };
> 
> const patreonRequest = await fetch('https://www.patreon.com/api/oauth2/token', {
> method: 'POST',
> body: JSON.stringify(patreonCheck),
> headers: { 
> 'Accept': '*/*',
> 'Content-Type': 'application/json',
> 'Connection': 'keep-alive',
> 'User-Agent': ua
> }
> });
> 
> ```

Can you help me to understand what can i do to fix this issue?

---

<div class="post-metadata">

### Author: ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)
#### Post date: [April 12, 2021, 3:24pm UTC](https://www.patreondevelopers.com/t/keep-getting-unsupported-grant-type/4379/2 "2021-04-12T15:24:57Z")

</div>

You will need to debug your call step by step it seems. You can use WP plugin’s calls and match them with yours to see where it is going wrong:

> <https://github.com/Patreon/patreon-wordpress/blob/master/classes/patreon_oauth.php>
