How to create a Zoom OAuth meeting link between servers in Python

Learning how to create a secure Zoom meeting link in Python for server-to-server communication with OAuth authentication is not difficult. Here are detailed instructions.

How to create a Zoom OAuth meeting link between servers in Python Picture 1

Whether you've integrated Zoom meetings into the Python app or are just planning to do so, Zoom says the JWT app will be decommissioned on September 1, 2023. You'll have to switch to the OAuth or server-to-server OAuth option to avoid service downtime.

The OAuth option requires the user to authenticate to the web via a Zoom account. But if you just create Zoom meeting links without user permissions, the server-to-server OAuth option is the ideal choice.

So how can you achieve this with Python?

Create OAuth app from server to server on Zoom

To get started, go to Zoom Marketplace to build a new app:

1. Scroll through the application list and locate the Server-to-Server OAuth banner . Then, click the Create button .

How to create a Zoom OAuth meeting link between servers in Python Picture 2

 

2. Enter a name for the application in the field provided. Then click Create . This action takes you to another page.

How to create a Zoom OAuth meeting link between servers in Python Picture 3

3. Copy all application credentials, including Account ID , Client ID , and Client Secret . Click Continue once done. You may want to paste them in the environment variables file to hide them.

How to create a Zoom OAuth meeting link between servers in Python Picture 4

5. On the following menu, fill in the basic information in the information field and press the Continue button .

How to create a Zoom OAuth meeting link between servers in Python Picture 5

5. Click Continue on the following page.

How to create a Zoom OAuth meeting link between servers in Python Picture 6

 

6. Next, click Add Scopes and add the following scopes; Get a meeting's encoded SIP URL  and View and manage all user meetings .

How to create a Zoom OAuth meeting link between servers in Python Picture 7

7. Click Continue . Finally, click Active your app to start interacting with the Zoom API via the OAuth server-to-server app.

How to create a Zoom OAuth meeting link between servers in Python Picture 8

Python code to create Zoom link

Once you've completed all the steps above, you can quickly create meeting links using the Zoom API. Here is the full code to do this:

import requests # thay thế bằng ID của bạn client_id = "" # thay thế bằng ID tài khoản của bạn account_id = "" # thay bằng bí mật client của bạn client_secret = "" auth_token_url = "https://zoom.us/oauth/token" api_base_url = "https://api.zoom.us/v2" # tạo hàm liên kết Zoom def create_meeting(topic, duration, start_date, start_time): data = { "grant_type": "account_credentials", "account_id": account_id, "client_secret": client_secret } response = requests.post(auth_token_url, auth=(client_id, client_secret), data=data) if response.status_code!=200: print("Unable to get access token") response_data = response.json() access_token = response_data["access_token"] headers = { "Authorization": f"Bearer {access_token}", "Content-Type": "application/json" } payload = { "topic": topic, "duration": duration, 'start_time': f'{start_date}T10:{start_time}', "type": 2 } resp = requests.post(f"{api_base_url}/users/me/meetings", headers=headers, json=payload) if resp.status_code!=201: print("Unable to generate meeting link") response_data = resp.json() content = { "meeting_url": response_data["join_url"], "password": response_data["password"], "meetingTime": response_data["start_time"], "purpose": response_data["topic"], "duration": response_data["duration"], "message": "Success", "status":1 } print(content)

 

This code first sends a query to Zoom's URL token for the authentication token. Pass this down through the header to Zoom's API, which returns a response containing the meeting details identified in the payload. The start time of the meeting (start_time) with the payload must be in ISO 8601 format (formatted with Python's string operator).

For example, you could call the function to schedule a meeting for 8/23, at 3:24 p.m. like this:

create_meeting( "Test Zoom Meeting", "60", "2023-08-23", "18:24", )

The API returns a JSON containing a variety of information, including the meeting link, password, ID, and more. You can print response_data and extract the data you need as done in the above code.

For example, the query results look like this:

How to create a Zoom OAuth meeting link between servers in Python Picture 9

Integrate Zoom Meeting into the application

While the example above doesn't include web or API integration, building the app with Django, Flask, FastAPI, or another Python framework, you can easily include your code in the codebase.

If you build an API, you can convert it into an endpoint that any client can use. You can even borrow this idea to build a web in a language other than Python.

Hope the above guide is useful to you!

4.5 ★ | 2 Vote

May be interested

  • How to delete Zoom accounts completelyHow to delete Zoom accounts completely
    online zoom meeting, online learning meeting tool is facing a series of allegations related to data security, if you want to permanently delete the zoom account to protect personal data, please visit refer to the article below.
  • Is it safe to use Zoom? Things to knowIs it safe to use Zoom? Things to know
    as zoom's coverage is greater than ever, from individual users to businesses, zoom is the ultimate solution for meeting and learning online. along with that many users questioned whether using zoom is really safe?
  • Compare Google Meet with Zoom: Which is the best online meeting software?Compare Google Meet with Zoom: Which is the best online meeting software?
    through comparing two online meeting software google meet and zoom. give you a more intuitive view and choose the right online meeting software to use. let's find out in this article!
  • 6 Steps to Secure Meetings on Zoom6 Steps to Secure Meetings on Zoom
    zoom meeting security? here are six tips you need to know and why you should know, especially given this company has a dark history regarding user privacy and security, regardless of the level of its awful popularity.
  • How to check Zoom running a secret web server on the MacHow to check Zoom running a secret web server on the Mac
    recently, a serious vulnerability was discovered in zoom, the popular online meeting application for mac. this article will show you how to check if zoom is running a secret web server and how to remove it.
  • Zoom: Every security issue uncovered in the video chat appZoom: Every security issue uncovered in the video chat app
    with the novel coronavirus causing a surge in work-from-home activity, zoom has quickly become the video meeting app of choice: daily meeting participants on the platform surged from 10 million in december to 200 million in march.
  • The young man 'clones' like Naruto in the middle of an online meeting to tease his colleaguesThe young man 'clones' like Naruto in the middle of an online meeting to tease his colleagues
    taking advantage of zoom's virtual wallpaper feature, this guy had to 'clone' himself while working online to 'troll' his colleagues.
  • Link download Zoom Meetings 5.0.0Link download Zoom Meetings 5.0.0
    zoom is a social and communication app that provides video calling and instant messaging for large groups of people. im and voip software developed by zoom video communications for students, corporate employees and business people to organize online meetings.
  • Manage files and folders in PythonManage files and folders in Python
    python also provides a variety of methods to handle various directory-related operations. in this article, we will learn about managing files and directories in python, namely creating folders, renaming folders, listing folders and working with them.
  • How to Enable and Disable Mic on ZoomHow to Enable and Disable Mic on Zoom
    this article will show you how to manually turn your mic off or on during a zoom meeting when using a computer, phone, or tablet. the article will also show you how to set up zoom so that your mic will automatically turn off and use.