Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- zoom_base_url = 'https://api.zoom.us/v1'
- zoom_api_key = 'API_KEY'
- zoom_api_secret = 'API_SECRET'
- credentials = {'api_key': zoom_api_key, 'api_secret': zoom_api_secret}
- meeting_data = {'type': 2, 'topic': 'test meeting', 'option_jbh': True, 'option_registration': True}
- # Retrieve users, take the first one as the host
- response = requests.post(zoom_base_url + '/user/list', credentials)
- host = response.json()['users'][0]
- host_id = host['id']
- # print("Host: {}".format(host))
- # Create meeting
- data = meeting_data.copy()
- data.update({'host_id': host_id})
- data.update(credentials)
- response = requests.post(zoom_base_url + '/meeting/create', data)
- meeting = response.json()
- meeting_id = meeting['id']
- meeting_start_url = meeting['start_url']
- # print("Meeting: {}".format(meeting))
- # Register to meeting
- data = registrant_data.copy()
- data.update({'id': meeting_id, 'host_id': host_id})
- data.update(credentials)
- response = requests.post(zoom_base_url + '/meeting/register', data)
- registration = response.json()
- # print("Registration: {}".format(registration))
- registrant_join_url = registration['join_url']
- print("Host start url: {}".format(meeting_start_url))
- print("Registrant join url: {}".format(registrant_join_url))
Advertisement
Add Comment
Please, Sign In to add comment