# Refresh Token issue in oauth zoom api

**URL:** <https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029>\
**Category:** API and Webhooks\
**Created:** [October 13, 2020, 8:45am UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029 "2020-10-13T08:45:38Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![marketing4](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@marketing4](https://devforum.zoom.us/u/marketing4)\
**Post date:** [October 13, 2020, 8:45am UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/1 "2020-10-13T08:45:38Z")

</div>

Hello, I am using OAuth token to schedule meeting using zoom api. But after 1 hour access token expired and when I try to generate new access token with old refresh token It gives the following issue:

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://zoom.us/oauth/token` resulted in a `401 Unauthorized` response: {“reason”:“Invalid Token!”,“error”:“invalid\_request”}

I am working in PHP.

---

<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:** [October 13, 2020, 8:45am UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/2 "2020-10-13T08:45:44Z")

</div>

Hey @marketing4

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…

> [@Can't use OAuth 2 api's to cURL into api and get new access token and refresh token](https://devforum.zoom.us/t/-/7484):
>
> I need to get a new access token and a refresh token using OAuth via cURL. I have worked with Jakob at Zoom support and he helped me set it up in Postman 2. When I copy that into a cURL statement from my software (FileMaker Pro cURL function), I do not get back both tokens. Instead, I get this error: {“reason”:“Invalid client\_id or client\_secret”,“error”:“invalid\_client”} The cURL request I copied from Postman looks like this: xcurl --location --request POST ‘[https://zoom.us/oauth/token?gra…](https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token=REFRESH_TOKEN)

> [@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:** ![marketing4](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@marketing4](https://devforum.zoom.us/u/marketing4)\
**Post date:** [October 13, 2020, 12:00pm UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/3 "2020-10-13T12:00:57Z")

</div>

Hi ,  
these threads are not working for me. i am getting this issue last 1 one week. please reply asap.

---

<div class="post-metadata">

**Author:** ![marketing4](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@marketing4](https://devforum.zoom.us/u/marketing4)\
**Post date:** [October 14, 2020, 11:20am UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/4 "2020-10-14T11:20:40Z")

</div>

Hi ,  
Please reply asap.

---

<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:** [October 15, 2020, 6:12pm UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/5 "2020-10-15T18:12:27Z")

</div>

Hi @marketing4,

Please reference these steps for refreshing a token:

> **[OAuth 2.0 - Authorization - Documentation](https://marketplace.zoom.us/docs/guides/auth/oauth)**
>
> OAuth with Zoom
> 
> The Zoom API uses OAuth 2.0 to authenticate and authorize users to make requests. To setup access credentials and request scopes for yo...

Note that the latest refresh token must always be used for the next refresh request.

Let me know if this helps,  
Will

---

<div class="post-metadata">

**Author:** ![marketing4](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@marketing4](https://devforum.zoom.us/u/marketing4)\
**Post date:** [October 16, 2020, 6:36am UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/6 "2020-10-16T06:36:37Z")

</div>

Hi will,

I have done all these things but its not working for me.

this is my code

$refresh\_token = $db-\>get\_refersh\_token();

```
        $client = new GuzzleHttp\Client(['base_uri' => 'https://zoom.us']);
        $response = $client->request('POST', '/oauth/token', [
            "headers" => [
                "Authorization" => "Basic ".base64_encode(CLIENT_ID.':'.CLIENT_SECRET)
            ],
            'form_params' => [
                "grant_type"=>"refresh_token",
                "refresh_token"=>$refresh_token
            ],
            
        ]);
       
         $db->update_access_token($response->getBody());

```

getting the error

**Fatal error** : Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://zoom.us/oauth/token` resulted in a `401 Unauthorized` response: {“reason”:“Invalid Token!”,“error”:“invalid\_request”} in /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111 Stack trace: #0 /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response)) #2 /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL) #3 /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}() #4 /var/www/html/skilrock-zoom-final/v in **/var/www/html/skilrock-zoom-final/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php** on line **111**

---

<div class="post-metadata">

**Author:** ![marketing4](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@marketing4](https://devforum.zoom.us/u/marketing4)\
**Post date:** [October 16, 2020, 8:19am UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/7 "2020-10-16T08:19:58Z")

</div>

i am getting this error in postman

 ![Screenshot from 2020-10-16 13-48-18](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/2/b/2bad1e27d07519b11a9aac948f52608bd499f7d0.png)

---

<div class="post-metadata">

**Author:** ![si.lakmali](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/si.lakmali/32/17207_2.png) [@si.lakmali](https://devforum.zoom.us/u/si.lakmali)\
**Post date:** [October 16, 2020, 7:41pm UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/8 "2020-10-16T19:41:49Z")

</div>

Did you solve this error?

---

<div class="post-metadata">

**Author:** ![marketing4](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@marketing4](https://devforum.zoom.us/u/marketing4)\
**Post date:** [October 17, 2020, 5:17am UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/9 "2020-10-17T05:17:36Z")

</div>

No,you have any solution to fix this issue.

---

<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:** [October 19, 2020, 7:30pm UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/10 "2020-10-19T19:30:05Z")

</div>

Hey @marketing4,

I just DM’d you—can you reply to my message with the requested value so that I can help debug?

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![marketing4](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@marketing4](https://devforum.zoom.us/u/marketing4)\
**Post date:** [October 22, 2020, 10:03am UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/11 "2020-10-22T10:03:43Z")

</div>

where can i see your DM’d ?

---

<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:** [October 22, 2020, 8:16pm UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/12 "2020-10-22T20:16:02Z")

</div>

Hey @marketing4,

You should have received an email or be able to view a DM from the top right hand side of your Forum account/dropdown menu.

If you still have trouble seeing the DM, you can send us an email at [developersupport@zoom.us](mailto:developersupport@zoom.us). Please include the value you’re passing for your authorization header with us either of these places (do not post this here, as this contains sensitive credentials). This will help us to debug!

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![marketing4](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@marketing4](https://devforum.zoom.us/u/marketing4)\
**Post date:** [October 26, 2020, 10:15am UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/14 "2020-10-26T10:15:47Z")

</div>

Hi,

Please respond so that we can close this issue.

Thanks,  
Ankur

---

<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:** [October 26, 2020, 10:57pm UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/15 "2020-10-26T22:57:34Z")

</div>

Hi @marketing4,

Thanks for sharing this. I’m not seeing any issues with your Authorization headers. I think there is likely still an issue with the `refresh_token` value you’re passing in the form\_params for your refresh request.

Can you please send us an email to [developersupport@zoom.us](mailto:developersupport@zoom.us) with the values you’re passing for your refresh\_token? We should be able to check our logs to look into this further. Please do not share this here, as these are sensitive details.

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:** [November 28, 2020, 8:38pm UTC](https://devforum.zoom.us/t/refresh-token-issue-in-oauth-zoom-api/33029/17 "2020-11-28T20:38:57Z")

</div>

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