# Refresh access\_token

**URL:** <https://devforum.zoom.us/t/refresh-access-token/22748>\
**Category:** API and Webhooks\
**Created:** [June 30, 2020, 9:38am UTC](https://devforum.zoom.us/t/refresh-access-token/22748 "2020-06-30T09:38:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![akira.k](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/akira.k/32/11220_2.png) [@akira.k](https://devforum.zoom.us/u/akira.k)\
**Post date:** [June 30, 2020, 9:38am UTC](https://devforum.zoom.us/t/refresh-access-token/22748/1 "2020-06-30T09:38:20Z")

</div>

OAuthで作成したaccess\_tokenを以下のコードでrefreshしようとしています。エラーは出ていない様子ですが、有効期限が1時間から延長されませんでした。どこか間違っているのでしょうか？  
I am trying to refresh the access\_token created in OAuth with the following code. No error appears, but the expiration date was not extended from 1 hour. Is something wrong?

```
<?php
$basic = base64_encode({{※Client_ID※}} . ':' . {{※Client_Secret※}});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token={{※refresh_token※}}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "authorization: Basic $basic"
    ),
));
    
$response = curl_exec($curl);
curl_close($curl);
?>
```

---

<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:** [July 1, 2020, 9:57pm UTC](https://devforum.zoom.us/t/refresh-access-token/22748/2 "2020-07-01T21:57:39Z")

</div>

Hey @akira.k,

What do you mean it was not extended from 1 hour?

In the [response](https://marketplace.zoom.us/docs/guides/auth/oauth#refreshing) you will get:

```json
"expires_in": 3599

```

This mean it will expire in 3599 minutes after you receive it from the response.

* * *

1時間から延長されなかったとはどういう意味ですか？

応答では、次のようになります。

「expires\_in」：3599  
これは、応答から受け取った後3599分で有効期限が切れることを意味します。

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![akira.k](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/akira.k/32/11220_2.png) [@akira.k](https://devforum.zoom.us/u/akira.k)\
**Post date:** [July 2, 2020, 12:30am UTC](https://devforum.zoom.us/t/refresh-access-token/22748/3 "2020-07-02T00:30:30Z")

</div>

Hi, Tommy.

I expect a POST with a “grant\_type=refresh\_token&refresh\_token=” URL to renew the expiration to 15 years.  
(I want to update the expiration in PHP, what is the method?)

I am referring to the following “Refreshing an Access Token” article.  
[https://marketplace.zoom.us/docs/guides/auth/oauth](https://marketplace.zoom.us/docs/guides/auth/oauth)

Thanks,  
Akira

---

<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:** [July 6, 2020, 6:47pm UTC](https://devforum.zoom.us/t/refresh-access-token/22748/4 "2020-07-06T18:47:19Z")

</div>

Hey @akira.k,

You can’t update the expiration, but you can get a new access and refresh token:

> **[OAuth 2.0 - Authorization - Documentation](https://marketplace.zoom.us/docs/guides/auth/oauth#refreshing)**
>
> 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...

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![akira.k](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/akira.k/32/11220_2.png) [@akira.k](https://devforum.zoom.us/u/akira.k)\
**Post date:** [July 7, 2020, 1:27am UTC](https://devforum.zoom.us/t/refresh-access-token/22748/5 "2020-07-07T01:27:47Z")

</div>

Hi, @tommy

I want to get an access\_token with the longest expiry time possible.  
Does my PHP code above not give me an access\_token with a 15 year expiration?

Or is there another way to get the Webinar schedule all the time?

Thanks,  
Akira

---

<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:** [July 8, 2020, 10:32pm UTC](https://devforum.zoom.us/t/refresh-access-token/22748/6 "2020-07-08T22:32:57Z")

</div>

Hey @akira.k,

Maybe the best solution would be to use a [JWT Token](https://marketplace.zoom.us/docs/guides/auth/jwt) and set the expiry to as long as you want.

However, we suggest generating a new one each use.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![akira.k](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/akira.k/32/11220_2.png) [@akira.k](https://devforum.zoom.us/u/akira.k)\
**Post date:** [July 14, 2020, 12:30am UTC](https://devforum.zoom.us/t/refresh-access-token/22748/7 "2020-07-14T00:30:40Z")

</div>

Hi, @tommy.

I understand.  
It seems that the purpose can be achieved by using JWT Token.

Thank you for your help.

Thanks,  
Akira

---

<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:** [July 15, 2020, 11:54pm UTC](https://devforum.zoom.us/t/refresh-access-token/22748/8 "2020-07-15T23:54:25Z")

</div>

You are welcome! 🙂

Please let me know if you have additional questions!

-Tommy

---

<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:** [August 21, 2020, 10:43pm UTC](https://devforum.zoom.us/t/refresh-access-token/22748/9 "2020-08-21T22:43:23Z")

</div>


