# Using oauth app of market place in python script

**URL:** <https://devforum.zoom.us/t/using-oauth-app-of-market-place-in-python-script/44277>\
**Category:** API and Webhooks\
**Created:** [February 25, 2021, 2:57pm UTC](https://devforum.zoom.us/t/using-oauth-app-of-market-place-in-python-script/44277 "2021-02-25T14:57:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul.patel](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rahul.patel/32/19439_2.png) [@rahul.patel](https://devforum.zoom.us/u/rahul.patel)\
**Post date:** [February 25, 2021, 2:57pm UTC](https://devforum.zoom.us/t/using-oauth-app-of-market-place-in-python-script/44277/1 "2021-02-25T14:57:04Z")

</div>

**Description**  
I have created a script to handle zoom recordings, but I want to create an zoom oauth app where user can install that app and python script can automatically use that generated access token.

**Error**  
Automate the process of authorization and fetching of access token. As after every 1 hour oauth access token is expired.

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
OAuth

**Which Endpoint/s?**  
recordings, user

---

<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:** [February 25, 2021, 9:27pm UTC](https://devforum.zoom.us/t/using-oauth-app-of-market-place-in-python-script/44277/2 "2021-02-25T21:27:44Z")

</div>

Hey @rahul.patel,

If you want to automate the process of user authorization, this should definitely be possible using our OAuth flow:

> **[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...

To clarify, requesting an OAuth access token (so that you can authenticate requests on behalf of a user to our recordings, users, etc. endpoints), consists of multiple requests.

First, the user needs to install the OAuth App and you need to retrieve a code. From there, you can automate the rest of the process outlined in the documentation above—requesting an access token from our /oauth endpoint, refreshing a token, sending a request to our Recordings endpoint, etc.

Here is an example of hitting our OAuth endpoint in Python:

```auto
import requests

url = "https://zoom.us/oauth/token?grant_type=authorization_code&code={code}&redirect_uri={yourOAuthAppsRedirectUri}"

payload = {}
headers = {
  'Authorization': 'Basic NnJFU2NHdU5UbGFOOThNM2NoVXNoQTpwMXhqS1dvNXhpVEt0aExpNDdEcVFMSzUzeE0zN0tQcw=='
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

```

Let me know if this helps!

Best,  
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:** [March 28, 2021, 7:28am UTC](https://devforum.zoom.us/t/using-oauth-app-of-market-place-in-python-script/44277/3 "2021-03-28T07:28:26Z")

</div>

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