# Zoom oauth refresh token giving { "reason": "Invalid Token!", "error": "invalid\_grant" }

**URL:** <https://devforum.zoom.us/t/zoom-oauth-refresh-token-giving-reason-invalid-token-error-invalid-grant/107870>\
**Category:** Authentication\
**Created:** [April 14, 2024, 7:43pm UTC](https://devforum.zoom.us/t/zoom-oauth-refresh-token-giving-reason-invalid-token-error-invalid-grant/107870 "2024-04-14T19:43:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vicky1999](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vicky1999/32/58668_2.png) [@vicky1999](https://devforum.zoom.us/u/vicky1999)\
**Post date:** [April 14, 2024, 7:43pm UTC](https://devforum.zoom.us/t/zoom-oauth-refresh-token-giving-reason-invalid-token-error-invalid-grant/107870/1 "2024-04-14T19:43:39Z")

</div>

Hello,  
I have created an App in zoom marketplace and is in draft status currently. I was able to authorize with the app and get the code, access and refresh token for the first time.  
But after an hour, when I tried to call the refresh token API, I am getting the response:  
{  
“reason”: “Invalid Token!”,  
“error”: “invalid\_grant”  
}

## Steps I followed:

FIrst we are checking if the user exist in our db if the user does not exist, then we will call the API:  
`https://zoom.us/oauth/authorize?client_id=6wG1sdT5QOyC3As57R4SA&response_type=code&redirect_uri=http://localhost:3000/de/user/redirect/zoom&code_challenge=<CODE_CHALLENGE>`

After allowing the access, I am getting the code which I use to call the oauth/token API and get the access and refresh token:

Endpoint: `https://zoom.us/oauth/token`

Request:  
code: `<CODE>`  
grant\_type: authorization\_code  
code\_verifier: \<CODE\_VERIFIER\>

Headers:  
Authorization: Basic base64(CLIENT\_ID:CLIENT\_SECRET)

This API is giving me the access and refresh token.

when I tried to use the refresh token to get a new access token, it is not working. I am pretty sure the refresh token is valid and I am calling the API in POST method.

Endpoint: `https://zoom.us/oauth/token`

grant\_type: refresh\_token  
refresh\_token: \<REFRESH\_TOKEN\>

Headers:  
Authorization: Basic base64(CLIENT\_ID:CLIENT\_SECRET)

Response:  
{  
“reason”: “Invalid Token!”,  
“error”: “invalid\_grant”  
}

I am following all the instructions mentioned in the oauth document: [https://developers.zoom.us/docs/zoom-rooms/oauth/#refreshing-an-access-token](https://developers.zoom.us/docs/zoom-rooms/oauth/#refreshing-an-access-token)

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [April 16, 2024, 2:18am UTC](https://devforum.zoom.us/t/zoom-oauth-refresh-token-giving-reason-invalid-token-error-invalid-grant/107870/2 "2024-04-16T02:18:15Z")

</div>

@vicky1999 what language are you using ? do you have some code samples?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [April 16, 2024, 9:22am UTC](https://devforum.zoom.us/t/zoom-oauth-refresh-token-giving-reason-invalid-token-error-invalid-grant/107870/3 "2024-04-16T09:22:11Z")

</div>

@vicky1999 Please correct the body of the request as like below

NodeJS sample:

```auto
 var payload = qs.stringify({
      refresh_token: zoomAuth.refresh_token,
      grant_type: HTTPCLIENT.OAuth.GRANT_TYPE.REFRESH_TOKEN,
      redirect_uri: `${process.env.HOST}/${process.env.ZOOM_OAUTH_REDIRECT_URI}`,
    });

```

---

<div class="post-metadata">

**Author:** ![vicky1999](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vicky1999/32/58668_2.png) [@vicky1999](https://devforum.zoom.us/u/vicky1999)\
**Post date:** [April 17, 2024, 4:03am UTC](https://devforum.zoom.us/t/zoom-oauth-refresh-token-giving-reason-invalid-token-error-invalid-grant/107870/4 "2024-04-17T04:03:48Z")

</div>

@chunsiong.zoom I am using nodejs for this with the default fetch API. Even with postman, it is not working

---

<div class="post-metadata">

**Author:** ![vicky1999](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vicky1999/32/58668_2.png) [@vicky1999](https://devforum.zoom.us/u/vicky1999)\
**Post date:** [April 17, 2024, 4:09am UTC](https://devforum.zoom.us/t/zoom-oauth-refresh-token-giving-reason-invalid-token-error-invalid-grant/107870/5 "2024-04-17T04:09:28Z")

</div>

@naeem.ahmedk I am still getting the same invalid token issue even trying with postman. Can you please share me the request json to check this in postman?

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [April 17, 2024, 4:52am UTC](https://devforum.zoom.us/t/zoom-oauth-refresh-token-giving-reason-invalid-token-error-invalid-grant/107870/6 "2024-04-17T04:52:01Z")

</div>

@vicky1999 can you check out this guide to setup your postman?

> **[Setting up Server-to-Server (S2S) OAuth to test Zoom APIs via Postman](https://jenzushsu.medium.com/setting-up-server-to-server-s2s-oauth-to-test-zoom-apis-via-postman-32c9cd7a73)**
>
> For those who have been integrating and developing on Zoom Developer Platform, this shouldn’t not be new to you. But, for those who are…

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [April 17, 2024, 11:03am UTC](https://devforum.zoom.us/t/zoom-oauth-refresh-token-giving-reason-invalid-token-error-invalid-grant/107870/7 "2024-04-17T11:03:42Z")

</div>

@vicky1999

Please watch sessions here

Zoom OAuth

[Part - 1](https://youtu.be/LY7jXL9FSqA)  
[Part - 2](https://youtu.be/ytkNxMyZ8_E)
