# Refresh token, not refreshing after 2-3 days of inactivity

**URL:** <https://devforum.zoom.us/t/refresh-token-not-refreshing-after-2-3-days-of-inactivity/29761>\
**Category:** API and Webhooks\
**Created:** [September 10, 2020, 9:07am UTC](https://devforum.zoom.us/t/refresh-token-not-refreshing-after-2-3-days-of-inactivity/29761 "2020-09-10T09:07:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![muhammad.faizan.cs](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/muhammad.faizan.cs/32/4144_2.png) [@muhammad.faizan.cs](https://devforum.zoom.us/u/muhammad.faizan.cs)\
**Post date:** [September 10, 2020, 9:07am UTC](https://devforum.zoom.us/t/refresh-token-not-refreshing-after-2-3-days-of-inactivity/29761/1 "2020-09-10T09:07:16Z")

</div>

Continuing the discussion from [Refresh token request failing with 401](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/85):

I have an app, that stores refreshToken and accessToken and I only refresh when a token is expired while user is performing an action and then i store new token back.  
In the recent test, I authorized my app 2 days ago, used it once and then didn’t touch it again. (means no activity in zoom)  
Then after 2-3 days when I tried to use my app and create a request to refresh token I received error that my token is expired. Which is beyond me. Because Its not the case where a new token is generated. Only I authorize my app and I haven’t touched it. as you stated that refreshToken have 15 years of expiry I highly doubt that. In case you want to investigate further, I can provide my zoom account that was authorized for the app I developed. And check the logs against it that either the request to refresh token was generated or the refreshToken was invalid itself.  
Here is my code in Javascript that refreshes the token. I am using “axios” so auth object creates Basic Auth token.

```auto
return request.post(`/oauth/token?grant_type=refresh_token&refresh_token=${refreshToken}`, {}, {
    auth: {
      username: process.env.ZOOM_CLIENT_ID,
      password: process.env.ZOOM_SECRET
    }
  })

```

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [September 10, 2020, 9:07am UTC](https://devforum.zoom.us/t/refresh-token-not-refreshing-after-2-3-days-of-inactivity/29761/2 "2020-09-10T09:07:48Z")

</div>

Hey @muhammad.faizan.cs

Thanks for posting on the Zoom Devforum! I am still learning, but I will try my best to help answer your question. 🙂

Checkout these related threads that may have the answer you are looking for:

> [@Failed to find the refresh Token. The Token may be regenerated](https://devforum.zoom.us/t/-/1767):
>
> &nbsp; Hello, We have a Zoom integration through a Zoom marketplace app and we’re seeing some odd patterns regarding refresh tokens. We’re following the docs in&nbsp;[https://devdocs.zoom.us/docs/authorization/oauth-with-zoom](https://devdocs.zoom.us/docs/authorization/oauth-with-zoom) To summarize: At the end of the OAuth flow, Zoom provides us both an access and a refresh token. When the access token expires, we use the refresh token to get a new access and refresh token. We store both&nbsp;of them for the next requests. Everything works smoothly, the weird thin…

> [@Refresh token doesn't work](https://devforum.zoom.us/t/-/6963):
>
> Hi all! Refresh token doesn’t work First getting refresh token: Uri: https://zoom.us/oauth/token Content: grant\_type=refresh\_token&refresh\_token=eyJhbGciOiJIUzUxMiJ9.eyJ2ZXIiOiI2IiwiY2xpZW50SWQiOiI0MUdyaVR6VVF4NlQ0dHpkWndSTDVBIiwiY29kZSI6IldFOWhpODJCQzdfSnUzU3FURGZRWkswdXpLRkxQWm41QSIsImlzcyI6InVybjp6b29tOmNvbm5lY3Q6Y2xpZW50aWQ6NDFHcmlUelVReDZUNHR6ZFp3Ukw1QSIsImF1dGhlbnRpY2F0aW9uSWQiOiJlNDUwNzUwZWI3N2NlN2UwZWRlMDliYzI5MDE3YTI0ZiIsImVudiI6W251bGxdLCJ1c2VySWQiOiJKdTNTcVREZlFaSzB1ektGTFBabjV…

If these threads did not help, please let us know by replying back here and someone from the Developer Relations team will get back to you shortly.

Thanks,  
DeveloperBot

---

<div class="post-metadata">

**Author:** ![muhammad.faizan.cs](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/muhammad.faizan.cs/32/4144_2.png) [@muhammad.faizan.cs](https://devforum.zoom.us/u/muhammad.faizan.cs)\
**Post date:** [September 10, 2020, 9:30am UTC](https://devforum.zoom.us/t/refresh-token-not-refreshing-after-2-3-days-of-inactivity/29761/3 "2020-09-10T09:30:37Z")

</div>

No it doesn’t help, I have gone thru them

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [September 14, 2020, 6:23pm UTC](https://devforum.zoom.us/t/refresh-token-not-refreshing-after-2-3-days-of-inactivity/29761/4 "2020-09-14T18:23:55Z")

</div>

Hi @muhammad.faizan.cs,

Please see my reply here:

> [@Refresh token request failing with 401](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/85):
>
> I have an app, that stores refreshToken and accessToken and I only refresh when a token is expired while user is performing an action and then i store new token back. In the recent test, I authorized my app 2 days ago, used it once and then didn’t touch it again. (means no activity in zoom) Then after 2-3 days when I tried to use my app and create a request to refresh token I received error that my token is expired. Which is beyond me. Because Its not the case where a new token is generated. O…

Thanks!  
Will

---

<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:** [October 15, 2020, 4:24am UTC](https://devforum.zoom.us/t/refresh-token-not-refreshing-after-2-3-days-of-inactivity/29761/5 "2020-10-15T04:24:05Z")

</div>

Closed on October 15, 2020, 4:24am UTC

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