# 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:** 4

<div class="post-metadata">

**Author:** ![ncsquared](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ncsquared/32/4150_2.png) [@ncsquared](https://devforum.zoom.us/u/ncsquared)\
**Post date:** [April 1, 2020, 4:02pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/61 "2020-04-01T16:02:16Z")

</div>

> [@ps40](#):
>
> grant\_type=refresh\_token&refresh\_token=

@tommy also experiencing this issue. DMing details to you. Thanks for all the help lately 🙂

---

<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, 5:06pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/62 "2020-04-01T17:06:01Z")

</div>

You are welcome! 🙂

Thanks for sending details, we are looking into this. (ZOOM-148612)

-Tommy

---

<div class="post-metadata">

**Author:** ![mattpegler](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@mattpegler](https://devforum.zoom.us/u/mattpegler)\
**Post date:** [April 1, 2020, 5:43pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/63 "2020-04-01T17:43:55Z")

</div>

Hi @tommy, we have 6 examples of this error from recent days. We lock while updating Zoom access tokens, so we are confident we are using the most recent refresh token. Would you like additional examples to help debug?

Edit: the access token is valid for the hour, as expected, but we get a 401 when trying to generate a new access token from our refresh token.

---

<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, 10:14pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/64 "2020-04-01T22:14:54Z")

</div>

Hey @mattpegler,

Apologies you are running into this issue.

Can you private message me your most recent access\_token and refresh\_token and Client ID so I can debug?

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:** [April 2, 2020, 5:27pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/65 "2020-04-02T17:27:11Z")

</div>

Hey @jford,

After looking into the logs, we have found that the issue is because the user uninstalled the application, so the token has been revoked

The user installed it on Mar 31, 2020 @ 20:27:35.183 (UTC) and uninstalled it on Mar 31, 2020 @ 21:31:42.850. And you got the error on Apr 1, 2020 @ 16:00:44.168.

Hey @ncsquared,

After looking into the logs, we have found that the issue is because you authorized the application twice but only hold the OAuth token from the first authorization

You authorized the application on Mar 26, 2020 @ 19:04:09.421 (UTC) and authorized the application again on Mar 26, 2020 @ 19:18:02.489. And you hold the token from first authorization. But these tokens will be revoked when the user authorize the application again. Make sure to save the latest tokens when re authorizing or refreshing the access\_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:** [April 2, 2020, 6:55pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/66 "2020-04-02T18:55:50Z")

</div>

Hey @tommy,

I got the error while the app was installed. The error time you mentioned is over a day after I posted you the error details.

Thanks,  
James

---

<div class="post-metadata">

**Author:** ![ncsquared](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ncsquared/32/4150_2.png) [@ncsquared](https://devforum.zoom.us/u/ncsquared)\
**Post date:** [April 2, 2020, 9:11pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/67 "2020-04-02T21:11:22Z")

</div>

Sharing in hopes this helps others on this thread…

I’ve been calling the API using `Content-Type: application/json` and a json payload to refresh the token. This is rejected by Zoom’s OAuth server with the error `401 { code: 124, message: 'invalid access token' }`, which is the same error given, when using a bad refresh token.

I switched my code to use ` application/x-www-form-urlencoded`, and it works like a charm.

@tommy the API docs section on OAuth doesn’t have an example request for token refresh. Because I’m an OAuth n00b, I assumed this endpoint will accept JSON posts like the rest of the API… Another doc improvement for your trello/jira/dev/null or a feature request for a different error message when the Content-Type is wrong 🙂

---

<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 3, 2020, 3:53am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/68 "2020-04-03T03:53:13Z")

</div>

Hey @ncsquared,

Strange, it should work with a type application JSON request too.

Here are the refresh docs: [https://marketplace.zoom.us/docs/guides/auth/oauth#refreshing](https://marketplace.zoom.us/docs/guides/auth/oauth#refreshing)

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:** [April 3, 2020, 3:53am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/69 "2020-04-03T03:53:50Z")

</div>

Hey @jford,

Strange. Can you try the install flow again and see if that fixes it?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![ncsquared](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ncsquared/32/4150_2.png) [@ncsquared](https://devforum.zoom.us/u/ncsquared)\
**Post date:** [April 3, 2020, 10:22am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/70 "2020-04-03T10:22:31Z")

</div>

@tommy good to know about this page. I thought this was the reference page [https://marketplace.zoom.us/docs/api-reference/using-zoom-apis](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis)

---

<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 3, 2020, 6:37pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/71 "2020-04-03T18:37:28Z")

</div>

Happy to help! 🙂

-Tommy

---

<div class="post-metadata">

**Author:** ![asif](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@asif](https://devforum.zoom.us/u/asif)\
**Post date:** [April 28, 2020, 7:47am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/74 "2020-04-28T07:47:24Z")

</div>

Hi Tommy,  
I am getting this error  
{  
“reason”: “Invalid Token!”,  
“error”: “invalid\_request”  
}

and here is my URL [https://zoom.us/oauth/token?grant\_type=refresh\_token&refresh\_token=](https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token=){refersh Token}

In header  
Authorization Basic base64Encode (Client\_ID:Client\_Secret)  
Please help me to resolve this

Thanks,

---

<div class="post-metadata">

**Author:** ![picktime](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/picktime/32/75234_2.png) [@picktime](https://devforum.zoom.us/u/picktime)\
**Post date:** [April 29, 2020, 2:28pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/75 "2020-04-29T14:28:31Z")

</div>

Hi I’m getting this error ’ {“reason”:“Invalid Token!”,“error”:“invalid\_request”} ’ for some reason which was working before. All of a sudden all of our users are reporting that zoom integration is not working. Please respond asap.

---

<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:** [May 4, 2020, 10:14pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/76 "2020-05-04T22:14:39Z")

</div>

Hey @asif,

Please make sure you are making a POST request and not a GET request.

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:** [May 4, 2020, 10:15pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/77 "2020-05-04T22:15:41Z")

</div>

Hey @picktime,

I will respond to you in your other thread:

> [@"Invalid Token!" error message when trying to refresh oauth token](https://devforum.zoom.us/t/invalid-token-error-message-when-trying-to-refresh-oauth-token/13363/17):
>
> Hi @tommy We confirm that we are not using GET. We are using only POST. It is working in development with dev client id & secret. It’s just not working in live. We are pretty sure that we are using live client id and secret and we are using POST. Everything seems to work except generating new access token with the latest refresh token. Can you please resolve this asap.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![picktime](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/picktime/32/75234_2.png) [@picktime](https://devforum.zoom.us/u/picktime)\
**Post date:** [May 5, 2020, 4:01am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/78 "2020-05-05T04:01:23Z")

</div>

Hi @tommy

Please can you verify the issue asap. We have been waiting on it for last 1 week. Please let us know if there is any update.

---

<div class="post-metadata">

**Author:** ![picktime](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/picktime/32/75234_2.png) [@picktime](https://devforum.zoom.us/u/picktime)\
**Post date:** [May 6, 2020, 5:37am UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/79 "2020-05-06T05:37:26Z")

</div>

Hi @tommy

Is there a way to directly get in touch with you?

---

<div class="post-metadata">

**Author:** ![michael.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael.zoom/32/37213_2.png) [@michael.zoom](https://devforum.zoom.us/u/michael.zoom)\
**Post date:** [May 8, 2020, 9:56pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/80 "2020-05-08T21:56:02Z")

</div>

For future note - We’re currently investigating with other users in the thread Tommy linked above

---

<div class="post-metadata">

**Author:** ![randers](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@randers](https://devforum.zoom.us/u/randers)\
**Post date:** [May 18, 2020, 10:39pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/81 "2020-05-18T22:39:23Z")

</div>

We have the same issue - is there any update?

---

<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:** [May 21, 2020, 11:24pm UTC](https://devforum.zoom.us/t/refresh-token-request-failing-with-401/6447/82 "2020-05-21T23:24:18Z")

</div>

For others reference, here is the solution to @picktime’s issue:

> [@"Invalid Token!" error message when trying to refresh oauth token](https://devforum.zoom.us/t/invalid-token-error-message-when-trying-to-refresh-oauth-token/13363/40):
>
> Happy to help @picktime! In case this can help others, Picktime’s issue was an empty space in the [authorize url](https://marketplace.zoom.us/docs/guides/auth/oauth#step-1-request-user-authorization) between the client\_id and redirect\_url query param: https://zoom.us/oauth/authorize?response\_type=code&client\_id={client\_id} &redirect\_uri={redirect\_url} -Tommy

Thanks,  
Tommy

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

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