# While trying to fetch access token , getting invalid authorization code with invalid grant type error

**URL:** <https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323>\
**Category:** Authentication\
**Created:** [April 29, 2022, 1:16pm UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323 "2022-04-29T13:16:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jomy.paul2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jomy.paul2/32/48774_2.png) [@jomy.paul2](https://devforum.zoom.us/u/jomy.paul2)\
**Post date:** [April 29, 2022, 1:16pm UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/1 "2022-04-29T13:16:26Z")

</div>

Hello,

While trying to fetch the access token with the auth code, it is failing with invalid authorization code with invalid grant type.

Provided the code details via [developersupport@zoom.us](mailto:developersupport@zoom.us).

---

<div class="post-metadata">

**Author:** ![jomy.paul2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jomy.paul2/32/48774_2.png) [@jomy.paul2](https://devforum.zoom.us/u/jomy.paul2)\
**Post date:** [May 3, 2022, 9:23am UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/2 "2022-05-03T09:23:16Z")

</div>

Could you kindly help regarding this issue

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [May 3, 2022, 9:26pm UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/3 "2022-05-03T21:26:05Z")

</div>

Hi @jomy.paul2 ,

Have you heard back from support yet? Are you able to successfully make API requests otherwise?

Thanks,  
Gianni

---

<div class="post-metadata">

**Author:** ![jomy.paul2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jomy.paul2/32/48774_2.png) [@jomy.paul2](https://devforum.zoom.us/u/jomy.paul2)\
**Post date:** [May 4, 2022, 7:12am UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/4 "2022-05-04T07:12:31Z")

</div>

Hi Gianni, didnt hear from support yet.

---

<div class="post-metadata">

**Author:** ![jomy.paul2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jomy.paul2/32/48774_2.png) [@jomy.paul2](https://devforum.zoom.us/u/jomy.paul2)\
**Post date:** [May 4, 2022, 6:26pm UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/5 "2022-05-04T18:26:54Z")

</div>

I also tried making API request, i get the same error

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [May 4, 2022, 11:18pm UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/6 "2022-05-04T23:18:13Z")

</div>

Hi @jomy.paul2 ,

Try following this guide please to get the correct OAuth token to make requests:

> [@Guide: Making a Zoom API Call with OAuth Credentials in Postman](https://devforum.zoom.us/t/guide-making-a-zoom-api-call-with-oauth-credentials-in-postman/64538):
>
> To publish an app on the Zoom Marketplace you must create an [OAuth app](https://marketplace.zoom.us/docs/guides/build/oauth-app/). When you’re ready to test making API calls, download the latest version of Postman and import the Zoom API collections following the steps outlined [here](https://marketplace.zoom.us/docs/guides/guides/postman/using-postman-to-test-zoom-apis/). There are Three Ways to Set up OAuth in Postman to Make API Requests We’re going to go through three ways to set up our OAuth application credentials to successfully authorize and access the Zoom API to make requests. The “Easy” Difficulty OAuth 2.0 Set Up in Postman We’…

Gianni

---

<div class="post-metadata">

**Author:** ![jomy.paul2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jomy.paul2/32/48774_2.png) [@jomy.paul2](https://devforum.zoom.us/u/jomy.paul2)\
**Post date:** [May 5, 2022, 7:09am UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/7 "2022-05-05T07:09:46Z")

</div>

Thanks Gianni for helping with the collection information. But I was not able to locate authentication apis from the collection.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/0/f07a42c60595c4b9db7afbb1a768233a200d4ebe.png)  
Similarly in zoom phone apis, could not locate authenication apis.

Could you kindly help regarding the same and provide a collection that has authentication apis.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [May 5, 2022, 4:37pm UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/8 "2022-05-05T16:37:29Z")

</div>

Hi @jomy,

What do you mean by authentication APIs? You can do OAuth authorization for each API endpoint by clicking the “authorization” tab and following the steps outlined in the guide.

Does that clarify what you were looking for?

Gianni

---

<div class="post-metadata">

**Author:** ![jomy.paul2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jomy.paul2/32/48774_2.png) [@jomy.paul2](https://devforum.zoom.us/u/jomy.paul2)\
**Post date:** [May 6, 2022, 9:51am UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/9 "2022-05-06T09:51:39Z")

</div>

Hi Gianni,

I was talking about APIs to fetch access, ZAK and refresh tokens. I am not finding those APIs in the collection to test.

Regards,  
Jomy

---

<div class="post-metadata">

**Author:** ![jomy.paul2](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jomy.paul2/32/48774_2.png) [@jomy.paul2](https://devforum.zoom.us/u/jomy.paul2)\
**Post date:** [May 9, 2022, 10:24am UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/11 "2022-05-09T10:24:51Z")

</div>

Hi Gianni, when i tried the steps - going to an API, and sending request to get tokens by providing my cliend id and secret. it created the tokens from postman.  
But via code with android sdk, it is failing. the error says invalid authorization code , invalid\_grant

---

<div class="post-metadata">

**Author:** ![gibron](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gibron/32/37298_2.png) [@gibron](https://devforum.zoom.us/u/gibron)\
**Post date:** [June 8, 2022, 1:09am UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/12 "2022-06-08T01:09:38Z")

</div>

I had this issue and was able to debug. I found it easier to start w/ a cURL and debug from there.  
My issue was that I was not using production clientID / client secret for the authorization credential

eg.

```auto
curl -X POST 
-H "Authorization: Basic [base64(clientID:clientSecret)]" 
-H "Content-Type: application/x-www-form-urlencoded" 
"https://zoom.us/oauth/token?grant_type=authorization_code&code=[access_code_from_OAuth_redirect&redirect_uri=[redirect_uri]"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 8, 2022, 11:09am UTC](https://devforum.zoom.us/t/while-trying-to-fetch-access-token-getting-invalid-authorization-code-with-invalid-grant-type-error/68323/13 "2022-07-08T11:09:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
