zoomus Python Wrapper

repository·develop·Indexed 42 days ago

https://github.com/prschmid/zoomus

A Python wrapper for the Zoom.us REST API (v1 and v2) that allows developers to programmatically manage users, meetings, webinars, and more. The ZoomClient provides access to various components including contacts, group, live_stream, meeting, metric, past_meeting, phone, recording, report, role, room, user, and webinar. It supports GDPR compliance for EU users via a configurable base_uri and returns requests.Response objects for all method calls.

Tokens
3.7K
Snippets
18
Records
20
Agent score
53%

What's inside zoomus

  1. Initialize the ZoomClient

    develop

    The ZoomClient requires a CLIENT_ID and CLIENT_SECRET. By default, the client uses the Zoom V2 API. You can also explicitly specify version 1 if needed.

    import json
    from zoomus import ZoomClient
    
    # Default (API V2)
    client = ZoomClient('CLIENT_ID', 'CLIENT_SECRET')
    
    # Explicitly using API V1
    client = ZoomClient('CLIENT_ID', 'CLIENT_SECRET', version=1)
  2. Use ZoomClient for GDPR compliance in the EU

    develop

    For users in the EU requiring GDPR compliance, you should initialize the ZoomClient with the API_GDPR base URI. This ensures requests are routed to the appropriate compliant endpoint.

    from zoomus import ZoomClient, API_VERSION_2, API_GDPR
    
    # Use API_GDPR to ensure compliance
    client = ZoomClient(
        client_id='YOUR_CLIENT_ID',
        client_secret='YOUR_CLIENT_SECRET',
        api_account_id='YOUR_ACCOUNT_ID',
        version=API_VERSION_2,
        base_uri=API_GDPR
    )
  3. Use ZoomClient as a context manager

    develop

    You can use ZoomClient within a with statement to manage the client lifecycle.

    from zoomus import ZoomClient
    
    with ZoomClient('CLIENT_ID', 'CLIENT_SECRET', 'ACCOUNT_ID') as client:
        user_list_response = client.user.list()
        # ... perform operations
  4. Create a user using API V2

    develop

    To create a user via the V2 API, pass a dictionary containing the action and user_info to the client.user.create method. Note: The documentation example uses **data which implies passing the dictionary as keyword arguments.

    params = {
      "action": "create",
      "user_info": {
        "email": "example@test.com",
        "type": 1,
        "first_name": "Terry",
        "last_name": "Jones"
      }
    }
    resp = client.user.create(**params)
    if resp.status_code == 200:
        print(resp.json())
  5. Initialize ZoomClient for V1 API

    develop

    If you need to use the older V1 API, set the version parameter to 1.

    Warning: Support for the V1 API is limited. No new V1 functionality is expected to be added.

    import json
    from zoomus import ZoomClient
    
    client = ZoomClient('CLIENT_ID', 'CLIENT_SECRET', 'ACCOUNT_ID', version=1)
  6. Initialize ZoomClient for GDPR compliance (EU users)

    develop

    To use Zoom's EU-specific endpoints for GDPR compliance, initialize the ZoomClient with a specific base_uri.

    Note: This will only function if your Zoom account is an EU account and has been configured as such by Zoom.

    import json
    from zoomus import ZoomClient
    
    client = ZoomClient('CLIENT_ID', 'CLIENT_SECRET', 'ACCOUNT_ID', base_uri="https://eu01api-www4local.zoom.us/v2")
  7. Initialize the ZoomClient (v2 default)

    develop

    By default, ZoomClient uses Zoom's V2 API. You must provide your CLIENT_ID, CLIENT_SECRET, and ACCOUNT_ID.

    Important: Every method call returns a requests.Response object. To access the actual data returned by the API, you must parse the .content attribute (e.g., using json.loads()). This design allows you to handle HTTP errors and status codes directly using the requests library interface.

    import json
    from zoomus import ZoomClient
    
    client = ZoomClient('CLIENT_ID', 'CLIENT_SECRET', 'ACCOUNT_ID')
    
    # Example: Listing users and their meetings
    user_list_response = client.user.list()
    user_list = json.loads(user_list_response.content)
    
    for user in user_list['users']:
        user_id = user['id']
        print(json.loads(client.meeting.list(user_id=user_id).content))
  8. Reference: Zoom Webinar Methods

    develop

    The client.webinar object provides access to webinar management endpoints.

    client.webinar.create(...)
    client.webinar.update(...)
    client.webinar.delete(...)
    client.webinar.list(...)
    client.webinar.get(...)
    client.webinar.end(...)
    client.webinar.register(...)
    client.webinar.add_panelists(...)
    client.webinar.list_panelists(...)
    client.webinar.remove_panelists(...)
  9. Reference: Zoom User Methods

    develop

    The client.user object provides access to user management endpoints. Refer to the official Zoom User API documentation for specific parameter requirements.

    client.user.cust_create(...)
    client.user.update(...)
    client.user.check_email(...)
    client.user.update_email(...)
    client.user.list(...)
    client.user.pending(...)
    client.user.get(...)
    client.user.get_by_email(...)
    client.user.get_settings(...)
    client.user.update_settings(...)