# Oauth 2.0 how to get a bearer token

**URL:** <https://devforum.zoom.us/t/oauth-2-0-how-to-get-a-bearer-token/51955>\
**Category:** API and Webhooks\
**Created:** [June 7, 2021, 10:27pm UTC](https://devforum.zoom.us/t/oauth-2-0-how-to-get-a-bearer-token/51955 "2021-06-07T22:27:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mooneym](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mooneym](https://devforum.zoom.us/u/mooneym)\
**Post date:** [June 7, 2021, 10:27pm UTC](https://devforum.zoom.us/t/oauth-2-0-how-to-get-a-bearer-token/51955/1 "2021-06-07T22:27:34Z")

</div>

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

**Description**  
I receive a status code of 200 from making an OAuth post request to get a bearer token.  
So I can use the API in Zoom, but I do not receive a bearer token it seems like I am receiving back a web page.

**Error**  
I do not receive an error message, but I do not receive a token  
there is more the length is quite long, there is no bearer token in the response it seems like what I get back is a full web page.

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
OAuth is what I am using I already set up registered an app on Zoom.

**Which Endpoint/s?**  
In Python, I am including a small sample of the code I use to get the token.  
user\_data\_64 = base64.b64encode(bytes(‘{0}:{1}’.format(client\_id, client\_secret), ‘utf-8’))  
headers = {‘Content-Type’ : ‘application/x-www-form-urlencoded’,  
‘Host’ : ‘[zoom.us](http://zoom.us)’,  
‘redirect\_uri’ : ‘[https://newmanu.edu/redirect](https://newmanu.edu/redirect)’,  
‘Authorization’ : ‘Basic {0}’.format(client\_id),  
‘grant\_type’ : ‘authorization\_code’  
}  
response = requests.post(url, headers = headers)

Screenshot.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/a/1ae730e734dbf78e2d76fad5cbce83dab05ae03e.png)

**Additional context**  
Add any other context about the problem here.

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [June 9, 2021, 4:45pm UTC](https://devforum.zoom.us/t/oauth-2-0-how-to-get-a-bearer-token/51955/2 "2021-06-09T16:45:48Z")

</div>

Hey @mooneym,

Thank you for reaching out to the Zoom Developer Forum. Make sure that you’re calling the request to Authorize for OAuth from a browser that supports JavaScript. This is because the authorization flow requires user interaction in order to allow users to confirm access and authorize the app.

If you are communicating server-to-server, you can use a [JWT App](https://marketplace.zoom.us/docs/guides/auth/jwt).

Let me know if that helps.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![mooneym](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mooneym](https://devforum.zoom.us/u/mooneym)\
**Post date:** [June 9, 2021, 6:11pm UTC](https://devforum.zoom.us/t/oauth-2-0-how-to-get-a-bearer-token/51955/3 "2021-06-09T18:11:06Z")

</div>

Hello Max,

That does help a little would a Flask app work?  
Do you have any places I could go to get familiar with building an app with Flask for Zoom.  
I have been meaning to learn Flask with OAuth 2.0.

Thanks,

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [June 10, 2021, 11:10pm UTC](https://devforum.zoom.us/t/oauth-2-0-how-to-get-a-bearer-token/51955/4 "2021-06-10T23:10:01Z")

</div>

Hey @mooneym,

You could use Flask to build your application but you would still want to send the user to the authorization URL in the front-end so they can authorize the app.

Let me know if you have any questions.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![mooneym](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mooneym](https://devforum.zoom.us/u/mooneym)\
**Post date:** [June 18, 2021, 3:37am UTC](https://devforum.zoom.us/t/oauth-2-0-how-to-get-a-bearer-token/51955/5 "2021-06-18T03:37:12Z")

</div>

Thanks, I figured out how to get a JWT token to get a refresh token.  
I do want to get a Flask application just need to have time to build one.

Thanks,

---

<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:** [June 18, 2021, 3:14pm UTC](https://devforum.zoom.us/t/oauth-2-0-how-to-get-a-bearer-token/51955/6 "2021-06-18T15:14:20Z")

</div>

Thanks for the update—let us know if you run into any other questions!

---

<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:** [July 19, 2021, 1:14am UTC](https://devforum.zoom.us/t/oauth-2-0-how-to-get-a-bearer-token/51955/7 "2021-07-19T01:14:37Z")

</div>

Closed on July 19, 2021, 1:14am UTC

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