# Refreshing Access Tokens

**URL:** <https://devforum.zoom.us/t/refreshing-access-tokens/68594>\
**Category:** API and Webhooks\
**Created:** [May 6, 2022, 8:46am UTC](https://devforum.zoom.us/t/refreshing-access-tokens/68594 "2022-05-06T08:46:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![meghana\_surepalli](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@meghana\_surepalli](https://devforum.zoom.us/u/meghana_surepalli)\
**Post date:** [May 6, 2022, 8:46am UTC](https://devforum.zoom.us/t/refreshing-access-tokens/68594/1 "2022-05-06T08:46:10Z")

</div>

## Using this template helps us debug your issues more effectively 🙂

**Description**  
I am Unable to refresh the access token and getting an error 401.Can you please look into it why the error is happening

**Error**  
[https://zoom.us/oauth/token?grant\_type=refresh\_token&refresh\_token=eyJhbGciOiJIUzUxMiIsInYiOiIyLjAiLCJraWQiOiJlNDNlMGJmYi0xY2VhLTQ4ODUtOWE2MS04MmU2ZTUyYjY4MTgifQ.eyJ2ZXIiOjcsImF1aWQiOiJmM2JmNWJkYjIyOWUwM2RmZWMzMmQzYzkwNDkyYTU5MyIsImNvZGUiOiJ5bmt1aXQ1NzZ3XzlfaEhSZDdDU1lhS08tMUFwM3ptTVEiLCJpc3MiOiJ6bTpjaWQ6Q3cxZ0tCYzJTN2lmZ0ZpNmlNTHFFQSIsImdubyI6MCwidHlwZSI6MSwidGlkIjowLCJhdWQiOiJodHRwczovL29hdXRoLnpvb20udXMiLCJ1aWQiOiI5X2hIUmQ3Q1NZYUtPLTFBcDN6bU1RIiwibmJmIjoxNjUxODA4MzAyLCJleHAiOjIxMjQ4NDgzMDIsImlhdCI6MTY1MTgwODMwMiwiYWlkIjoidUdHLTZ0XzVRc1N0UXZDQ1JfaUNxUSIsImp0aSI6ImUyOTIwOGFiLWQwMzMtNDNlMS1iYTYyLWJkNGFlY2ViNjg5NCJ9.06COP-XuGXCohJ5aJNAXwtN7K9t-v90AwKP7Jmd1h8L6fEcdjRVw5ukP9KCs3OU9gVpmt\_hoMS9ciDxRWUnMPQ](https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token=eyJhbGciOiJIUzUxMiIsInYiOiIyLjAiLCJraWQiOiJlNDNlMGJmYi0xY2VhLTQ4ODUtOWE2MS04MmU2ZTUyYjY4MTgifQ.eyJ2ZXIiOjcsImF1aWQiOiJmM2JmNWJkYjIyOWUwM2RmZWMzMmQzYzkwNDkyYTU5MyIsImNvZGUiOiJ5bmt1aXQ1NzZ3XzlfaEhSZDdDU1lhS08tMUFwM3ptTVEiLCJpc3MiOiJ6bTpjaWQ6Q3cxZ0tCYzJTN2lmZ0ZpNmlNTHFFQSIsImdubyI6MCwidHlwZSI6MSwidGlkIjowLCJhdWQiOiJodHRwczovL29hdXRoLnpvb20udXMiLCJ1aWQiOiI5X2hIUmQ3Q1NZYUtPLTFBcDN6bU1RIiwibmJmIjoxNjUxODA4MzAyLCJleHAiOjIxMjQ4NDgzMDIsImlhdCI6MTY1MTgwODMwMiwiYWlkIjoidUdHLTZ0XzVRc1N0UXZDQ1JfaUNxUSIsImp0aSI6ImUyOTIwOGFiLWQwMzMtNDNlMS1iYTYyLWJkNGFlY2ViNjg5NCJ9.06COP-XuGXCohJ5aJNAXwtN7K9t-v90AwKP7Jmd1h8L6fEcdjRVw5ukP9KCs3OU9gVpmt_hoMS9ciDxRWUnMPQ)  
response \<Response [401]\>

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:  
def refreshZoomToken(self):  
“”“Refresh access token”“”  
#print(self.client\_id)  
#b64encoded = base64.b64encode(self.get\_userpass)  
encoded\_u = base64.b64encode(self.get\_userpass.encode()).decode()  
# print(encoded\_u)  
with open(self.get\_tokenfile, ‘r’) as f:  
token\_json = json.loads((f.read()))  
refresh\_token = token\_json[‘refresh\_token’]  
#print(refresh\_token)  
header = {‘Authorisation’ : ‘Basic %s’ % encoded\_u, ‘content-type’:‘application/x-www-form-urlencoded’}  
payload = (“grant\_type=refresh\_token&refresh\_token={0}”).format(refresh\_token)  
response = requests.post(self.token\_url, params=payload, headers=header)  
print(response.request.url)  
print(“response”,response)  
if response.status\_code == 200:  
results = json.loads(response.text)  
print({} ,format(results))

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [May 6, 2022, 8:28pm UTC](https://devforum.zoom.us/t/refreshing-access-tokens/68594/2 "2022-05-06T20:28:28Z")

</div>

Hi @meghana_surepalli

Thanks for reaching out to the Zoom Developer Forum and welcome to our community!  
Have you been able to follow the steps listed here in our Docs, on how to refresh an access token?

> **[Zoom Developer Docs](https://marketplace.zoom.us/docs/guides/auth/oauth/#refreshing-an-access-token)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

Cheers,  
Elisa

---

<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:** [June 6, 2022, 6:28am UTC](https://devforum.zoom.us/t/refreshing-access-tokens/68594/3 "2022-06-06T06:28:47Z")

</div>

Closed on June 6, 2022, 6:28am UTC

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