Package: zoom-api-helper
Zoom API HelperUtilities to interact with theZoom API v2Free software: MIT licenseDocumentation:https://zoom-api-helper.readthedocs.io.InstallationThe Zoom API Helper library is availableon PyPI, and can be installed withpip:$pipinstallzoom-api-helperYou’ll also need to create a Server-to-Server OAuth app as outlinedin the docs.FeaturesZoom API v2: List users, create meetings, and bulk create meetings.Support for aServer-to-Server OAuthflow.Local caching of access token retrieved from OAuth process.QuickstartStart by creating a helper
client (ZoomAPI) to interact with the Zoom API:>>>fromzoom_api_helperimportZoomAPI>>>zoom=ZoomAPI('<CLIENT ID>','<CLIENT SECRET>',...# can also be specified via `ZOOM_ACCOUNT_ID` env variable...account_id='<ACCOUNT ID>')Retrieve a list of users viaZoomAPI.list_users():>>>zoom.list_users(){'page_count':3,'page_number':1,'page_size':300,'total_records':700,'users':[{'id':'-abc123','first_name':'Jon','last_name':'Doe','email':'jdoe@email.org','timezone':'America/New_York',...},...]}Or, a mapping of each Zoom user’sEmailtoUser ID:>>>zoom.user_email_to_id(use_cache=True){'jdoe@email.org':'-abc123','dsimms@email2.org':'-xyz321',...}Create an individual meeting viaZoomAPI.create_meeting():>>>zoom.create_meeting(topic='My Awesome Meeting'){'uuid':'T9SwnVWzQB2dD1zFQ7PxFA==','id':91894643201,'host_id':'...','host_email':'me@email.org','topic':'My Awesome Meeting','type':2,...}Tobulk createa list of meetings in a concurrent fashion, please see the
section onBulk Create Meetingsbelow.Local StorageThis library uses a local storage for cache purposes, located under
the user home directory at~/.zoom/cacheby default – though this
location can be customized, via theCACHE_DIRenvironment variable.The format of the filenames containing cached data will look something similar to this:{{ Purpose }}_{{ Zoom Account ID }}_{{ Zoom Client ID }}.jsonCurrently, the helper library utilizes a local file cache for two purposes:Storing the access token retrieved fromthe OAuth step, so that the token
only needs to be refreshed after~1 hour.Storing a cached mapping of Zoom User emails to User IDs, as generally
the Zoom APIs only require the User ID’s.As otherwise, retrieving this mapping from the API can sometimes
be expensive, especially for Zoom accounts that have a lot of Users (1000+).Bulk Create MeetingsIn order tobulk create meetings– for example, if you need to create 100+
meetings in a short span of time – use theZoomAPI’sbulk_create_meetings()method.This allows you to pass in an Excel (.xlsx) file containing the meetings to
create, or else pass in therowswith the meeting info directly.ExampleSuppose you have an Excel file (meeting-info.xlsx) with the following data:Group NameZoom UsernameTopicMeeting DateMeeting TimeDuration HrDuration MinMeeting URLMeeting IDPasscodeA-BC:TEST:Sample Group 1host1@email.comTEST Meeting #1: Just an example10/26/253:30 PM130A-BC:TEST:Sample Group 2host1@email.comTEST Meeting #2: Here’s another one11/27/257:00 PM10A-BC:TEST:Sample Group 3host2@email.comTEST Meeting #3: This is the last for now9/29/259:00 PM115Then, here is a sample code that would allow you tobulk createthe specified
meetings in the Zoom Account.Note: replace the credentials such as<CLIENT ID>below as needed.fromdatetimeimportdatetimefromzoom_api_helperimportZoomAPIfromzoom_api_helper.modelsimport*defmain():zoom=ZoomAPI('<CLIENT ID>','<CLIENT SECRET>','<ACCOUNT ID>')# (optional) column header to keyword argumentcol_name_to_kwarg={'Group Name':'agenda','Zoom Username':'host_email'}# (optional) predicate function to initially process the row datadefprocess_row(row:'RowType',dt_format='%Y-%m-%d%I:%M %p'):start_time=f"{row['Meeting Date'][:10]}{row['Meeting Time']}"row.update(start_time=datetime.strptime(start_time,dt_format),# Zoom expects the `duration` value in minutes.duration=int(row['Duration Hr'])*60+int(row['Duration Min']),)returnTrue# (optional) function to update row(s) with the API responsedefupdate_row(row:'RowType',resp:dict):row['Meeting URL']=resp['join_url']row['Meeting ID']=resp['id']row['Passcode']=resp['password']# create meetings with dry run enabled.zoom.bulk_create_meetings(col_name_to_kwarg,excel_file='./meeting-info.xlsx',default_timezone='America/New_York',process_row=process_row,update_row=update_row,# comment out below line to actually create the meetings.dry_run=True,)if__name__=='__main__':main()CreditsThis package was created withCookiecutterand thernag/cookiecutter-pypackageproject template.History0.1.1 (2022-09-07)Update docs.0.1.0 (2022-09-06)First release on PyPI.