# Refresh token request failing with 401

**URL:** <https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447>\
**Category:** API and Webhooks\
**Created:** [October 29, 2019, 6:21pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447 "2019-10-29T18:21:43Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [November 22, 2019, 11:04pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/41 "2019-11-22T23:04:37Z")

</div>

Hey @nathan.arora,

Can you please Private Message me your access\_token and refresh\_token.

We believe this is an issue on our end and are working to fix it.

Thanks for your patience,  
Tommy

---

<div class="post-metadata">

**Author:** ![nathan.arora](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@nathan.arora](https://devforum.zoom.us/u/nathan.arora)\
**Post date:** [November 25, 2019, 3:45pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/42 "2019-11-25T15:45:58Z")

</div>

Hi @tommy

I am getting an error when I try to PM you. It says “Sorry, you cannot send a personal message to that user.” Please advise.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [November 25, 2019, 5:21pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/43 "2019-11-25T17:21:17Z")

</div>

Hey @nathan.arora,

I just PM’d you.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tsykul](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tsykul/32/2069_2.png) [@tsykul](https://devforum.zoom.us/u/tsykul)\
**Post date:** [December 18, 2019, 7:52pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/44 "2019-12-18T19:52:44Z")

</div>

Hi @tommy!

We’re experiencing a similar issue with our app. Can you please help to figure out what’s going on?

Our app id is U\_IYrxQpTFydKKQuO9tCQw

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [December 18, 2019, 9:31pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/45 "2019-12-18T21:31:37Z")

</div>

Hey @tsykul,

Can you please provide the App Name?

Also are you using the most recent refresh token each time? Please also share the exact error message you get.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tsykul](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tsykul/32/2069_2.png) [@tsykul](https://devforum.zoom.us/u/tsykul)\
**Post date:** [December 19, 2019, 1:10pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/46 "2019-12-19T13:10:19Z")

</div>

@tommy App name is People.ai (we’ve experienced the issue with the private app with the id above, although we have an approved app now too).

Error message is as above {“reason”:“Invalid Token!”,“error”:“invalid\_request”}.

We are using the latest refresh token, although it’s possible there’s a race condition somewhere. Is auth api idempotent?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [December 19, 2019, 9:11pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/47 "2019-12-19T21:11:17Z")

</div>

Hey @tsykul,

Try reinstalling the app which will reset the tokens. If the issue is not a race condition on your end with the refresh token, then it is possible it is related to an issue on our end that we are releasing a fix for at the end of this month.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [December 24, 2019, 8:58pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/48 "2019-12-24T20:58:06Z")

</div>

Hey @tsykul, @nathan.arora, @alon, @roy, @shane.zoom, @ps40,

Here are updates on the Invalid Token bug:

Conditions: This problem can arise when a token is granted and then  
immediately used to call a Zoom API endpoint. The server that issues  
the new token sets the nbf (not valid before) time to be the time  
“exactly now.” But not all servers at Zoom have synchronized  
clocks. If the token is immediately used for an API endpoint that is  
on a different server, that server’s local clock may be up to a second  
too slow, with a time before the token’s nbf time, causing the server  
to reject the token.

This bug applies to:

- All token requests: Both original token grants, and refresh grants.
- All tokens: that includes JWT tokens, as well as OAuth tokens of  
both grant types: authorization\_code and client\_credentials.

Reproducibility: This problem is either 0% or 90% reproducible: it  
depends how the Zoom load balancer forwards API requests to Zoom  
servers. It can happen either all the time, or not at all, depending  
on your source IP address.

Fix time: We will have a fix that will roll out in an upcoming release.

Work-around: After acquiring a token, wait 1 second before using it.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [January 6, 2020, 8:10pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/49 "2020-01-06T20:10:39Z")

</div>

Hey @tsykul, @nathan.arora, @alon, @roy, @shane.zoom, @ps40,

UDPATE: Fixed on Sunday Jan 5th.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![reggieofarrell](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/reggieofarrell/32/3878_2.png) [@reggieofarrell](https://devforum.zoom.us/u/reggieofarrell)\
**Post date:** [March 21, 2020, 1:03am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/50 "2020-03-21T01:03:00Z")

</div>

I’m actually also experiencing this issue on an app that I just started developing. Same issue. When trying to refresh tokens I’m getting a 401 with

`{"reason":"Invalid Token!","error":"invalid_request"}`.

We are persisting the access\_token and refresh\_token to Firebase after initial validation, but can’t ever seem to get a successful refresh.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [March 23, 2020, 6:45am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/51 "2020-03-23T06:45:01Z")

</div>

Hey @reggieofarrell, thanks for posting and using Zoom!

Can you please share how you are making the refresh request? Feel free to private message me your request url and headers.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![reggieofarrell](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/reggieofarrell/32/3878_2.png) [@reggieofarrell](https://devforum.zoom.us/u/reggieofarrell)\
**Post date:** [March 23, 2020, 11:38pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/52 "2020-03-23T23:38:22Z")

</div>

If the `access_token` is expired we are making a request to refresh like…

`const url = `[https://zoom.us/oauth/token?grant\_type=refresh\_token&refresh\_token=${zoom\_refresh\_token}](https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token=%24%7Bzoom_refresh_token%7D)`;`

`return requestPromise.post(url).auth(process.env.ZOOM_CLIENT_ID, process.env.ZOOM_CLIENT_SECRET);`

I’m using a similar `requestPromise` (different url of course) call to get the first `auth_token` so that setup seems to pass the headers correctly. I’ll PM you what the error shows the request headers to be.

---

<div class="post-metadata">

**Author:** ![rafal](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rafal](https://devforum.zoom.us/u/rafal)\
**Post date:** [March 24, 2020, 8:29am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/53 "2020-03-24T08:29:12Z")

</div>

Same issue here. I DM`ed you @tommy

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [March 24, 2020, 7:24pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/54 "2020-03-24T19:24:48Z")

</div>

Thanks @rafal, and @reggieofarrell,

I will answer you in the DM.

-Tommy

---

<div class="post-metadata">

**Author:** ![ccastellanos](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ccastellanos/32/3149_2.png) [@ccastellanos](https://devforum.zoom.us/u/ccastellanos)\
**Post date:** [March 31, 2020, 12:55am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/55 "2020-03-31T00:55:41Z")

</div>

same issue here ☹  
{  
“reason”: “Invalid Token!”,  
“error”: “invalid\_request”  
}  
I update my token and save the new refresh token but afther 1 hour i try to refresh token agian when the “new” refresh token saved and i got error.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [March 31, 2020, 6:25am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/56 "2020-03-31T06:25:53Z")

</div>

Hey @ccastellanos,

Can you share your request URL and headers?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![ccastellanos](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ccastellanos/32/3149_2.png) [@ccastellanos](https://devforum.zoom.us/u/ccastellanos)\
**Post date:** [March 31, 2020, 3:20pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/57 "2020-03-31T15:20:25Z")

</div>

sure @tommy  
this is my request.

url POST request: [https://api.zoom.us/oauth/token](https://api.zoom.us/oauth/token)

headers  
{“key”:“Authorization”,“value”:“Basic XXXXXXXX”}

params:  
grant\_type: refresh\_token  
refresh\_token: XXXXXX

answer:

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

When i get the access token i save all answer, included the refresh token. 1hr later i try to refresh token with the refresh token saved previously and get the error.  
ty

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [March 31, 2020, 5:56pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/58 "2020-03-31T17:56:00Z")

</div>

Hey @ccastellanos,

This error happens when you are using an outdated refresh token, (outdated as in a newer one exists, but you aren’t using the new one). Can you try uninstalling your app and reinstalling it, and make sure you are using the latest refresh token?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![jford](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jford/32/3432_2.png) [@jford](https://devforum.zoom.us/u/jford)\
**Post date:** [March 31, 2020, 11:26pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/59 "2020-03-31T23:26:14Z")

</div>

> [@tommy](#):
>
> en, (outdated as in a newer one exists, but you aren’t using the new one). Can you try uninstalling your app and reinstalling it, and make s

Hi @tommy,

I am actually experiencing this issue as well, refreshing a token. I am certainly using the most recent refresh token that was provided when I got the access token.

I will DM you the refresh headers, as I saw you ask someone else for.

Thanks!  
James

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [April 1, 2020, 7:05am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/60 "2020-04-01T07:05:05Z")

</div>

Thanks @jford,

I will take a look!

-Tommy

[Previous page](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447.md?page=2)

[Next page](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447.md?page=4)
