Skip to content

ballerina-platform/module-ballerinax-zoom.scheduler

Repository files navigation

Ballerina Zoom Scheduler connector

Build GitHub Last Commit GitHub Issues

Overview

Zoom is a video communications platform that enables users to schedule, host, and join virtual meetings, webinars, and conferences.

The ballerinax/zoom.scheduler package offers APIs to connect and interact with Zoom Scheduler endpoints, specifically based on Zoom API v2.

Setup guide

To use the ballerinax/zoom.scheduler connector, you must have access to the Zoom API through Zoom Marketplace and a project under it. If you do not have a Zoom account, you can sign up for one here.

Step 1: Create a new app

  1. Open the Zoom Marketplace.

  2. Click "Develop" → "Build App"

    Zoom marketplace

  3. Choose "General App" app type (for user authorization with refresh tokens)

    App Type

  4. Fill in basic information

Step 2: Configure OAuth settings

  1. Note down your credentials:

    • Client ID
    • Client Secret

    App Credentials

  2. Set redirect URI: Add your application's redirect URI (e.g., http://localhost:8080/callback)

    Redirect URI

  3. Add scopes: Make sure your Zoom app has the necessary scopes for the Scheduler API:

    • Add scheduler:read, scheduler:write and user:read in the scope

    Zoom Scopes

Step 3: Activate the app

  1. Complete all required information

  2. Activate the app

    Activate App

Step 4: Get user authorization

  1. Direct users to authorization URL (replace YOUR_CLIENT_ID and YOUR_REDIRECT_URI):
https://zoom.us/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=scheduler:read scheduler:write user:read
  1. User authorizes the app and gets redirected to your callback URL with an authorization code

  2. Exchange authorization code for tokens:

curl -X POST https://zoom.us/oauth/token \
  -H "Authorization: Basic $(echo -n 'CLIENT_ID:CLIENT_SECRET' | base64)" \
  -d "grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=YOUR_REDIRECT_URI"

This returns both access_token and refresh_token.

Replace:

  • CLIENT_ID with your app's Client ID
  • CLIENT_SECRET with your app's Client Secret
  • AUTHORIZATION_CODE with the code received from the callback
  • YOUR_REDIRECT_URI with your configured redirect URI

Step 5: Verify your setup

curl -X GET "https://api.zoom.us/v2/users/me" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

This will give you the user ID needed for API calls.

Quickstart

To use the ballerinax/zoom.scheduler connector in your Ballerina application, update the .bal file as follows:

Step 1: Import the module

Import the zoom.scheduler module.

import ballerinax/zoom.scheduler as zoom;

Step 2: Instantiate a new connector

  1. Create a Config.toml file and, configure the obtained credentials in the above steps as follows:
clientId = "<Client ID>"
clientSecret = "<Client Secret>"
refreshToken = "<Refresh Token>"
userId = "<Zoom User ID>"
  1. Create a zoom.scheduler:ConnectionConfig with the obtained access token and initialize the connector with it.
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;
configurable string userId = ?;

final zoom:Client zoomClient = check new ({
    auth: {
        clientId,
        clientSecret,
        refreshUrl: "https://zoom.us/oauth/token",
        refreshToken
    }
});

Step 3: Invoke the connector operation

Now, utilize the available connector operations.

Create a schedule

public function main() returns error? {
    zoom:InlineResponse2011 schedule = check zoomClient->/schedules.post(
        payload = {
            summary: "Team Meeting",
            description: "Weekly team sync",
            duration: 60
        }
    );
    io:println("Schedule created with ID: ", schedule.scheduleId);
}

Step 4: Run the Ballerina application

bal run

Examples

The Zoom Scheduler connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:

  1. Meeting Scheduler - Create scheduled meetings, generate single-use scheduling links, and manage team meeting schedules with automated booking capabilities.

  2. Availability Manager - Configure availability schedules, analyze scheduler analytics, and manage working hours for different time zones and business requirements.

Issues and projects

The Issues and Projects tabs are disabled for this repository as this is part of the Ballerina library. To report bugs, request new features, start new discussions, view project boards, etc., visit the Ballerina library parent repository.

This repository only contains the source code for the package.

Build from the source

Setting up the prerequisites

  1. Download and install Java SE Development Kit (JDK) version 21. You can download it from either of the following sources:

    Note: After installation, remember to set the JAVA_HOME environment variable to the directory where JDK was installed.

  2. Download and install Ballerina Swan Lake.

  3. Download and install Docker.

    Note: Ensure that the Docker daemon is running before executing any tests.

  4. Export Github Personal access token with read package permissions as follows,

    export packageUser=<Username>
    export packagePAT=<Personal access token>

Build options

Execute the commands below to build from the source.

  1. To build the package:

    ./gradlew clean build
  2. To run the tests:

    ./gradlew clean test
  3. To build the without the tests:

    ./gradlew clean build -x test
  4. To run tests against different environments:

    ./gradlew clean test -Pgroups=<Comma separated groups/test cases>
  5. To debug the package with a remote debugger:

    ./gradlew clean build -Pdebug=<port>
  6. To debug with the Ballerina language:

    ./gradlew clean build -PbalJavaDebug=<port>
  7. Publish the generated artifacts to the local Ballerina Central repository:

    ./gradlew clean build -PpublishToLocalCentral=true
  8. Publish the generated artifacts to the Ballerina Central repository:

    ./gradlew clean build -PpublishToCentral=true

Contribute to Ballerina

As an open-source project, Ballerina welcomes contributions from the community.

For more information, go to the contribution guidelines.

Code of conduct

All the contributors are encouraged to read the Ballerina Code of Conduct.

Useful links

About

Ballerina Zoom Scheduler connector

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •