Zoom is a widely-used video conferencing service provided by Zoom Video Communications, enabling users to host and attend virtual meetings, webinars, and collaborate online.
The ballerinax/zoom.meetings
package offers APIs to connect and interact with Zoom API endpoints, specifically based on Zoom API v2.
To use the Zoom meetings 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.
-
Open the Zoom Marketplace.
-
Click "Develop" → "Build App"
-
Choose "General App" app type (for user authorization with refresh tokens)
-
Fill in Basic Information, choose Admin-managed option.
-
Note down your credentials:
- Client ID
- Client Secret
-
Set Redirect URI: Add your application's redirect URI
-
Add scopes: Make sure your Zoom app has the necessary scopes for the meetings API:
- Add
meetings:read
,meetings:write
anduser:read
in the scope
- Add
-
Complete all necessary information fields.
-
Once, the necessary fields are correctly filled, app will be activated.
-
Direct users to authorization URL (replace
YOUR_CLIENT_ID
andYOUR_REDIRECT_URI
):https://zoom.us/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=meetings:read meetings:write user:read
-
User authorizes the app and gets redirected to your callback URL with an authorization code
-
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
andrefresh_token
.Replace:
CLIENT_ID
with your app's Client IDCLIENT_SECRET
with your app's Client SecretAUTHORIZATION_CODE
with the code received from the callbackYOUR_REDIRECT_URI
with your configured redirect URI
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.
To use the Zoom
connector in your Ballerina application, update the .bal
file as follows:
Import the zoom.meetings
module.
import ballerinax/zoom.meetings;
-
Create a
Config.toml
file and, configure the obtained credentials in the above steps as follows:refreshToken = "<refresh Token>" refreshUrl = "<refresh URL>" userId = "<user_id>" clientId = "<client_id>" clientSecret = "<client_secret>"
-
Create a
zoom.meeting:ConnectionConfig
with the obtained access token and initialize the connector with it.configurable string refreshToken = ?; ConnectionConfig config = { auth: { refreshToken, clientId, clientSecret, refreshUrl } }; final Client zoomClient = check new Client(config, serviceUrl);
Now, utilize the available connector operations.
meetings:InlineResponse20028 response = check zoomClient->/users/[originalId]/meetings();
meetings:InlineResponse20028Meetings[]? meetings = response.meetings;
if meetings is () {
io:println("No upcoming meetings found.");
return;
}
foreach var meeting in meetings {
if meeting.id is int && meeting.topic is string {
io:println("Meeting ID: ", meeting.id);
io:println("Topic : ", meeting.topic);
io:println("-------------------------------");
}
}
bal run
The Zoom Meetings
connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
-
Create a Zoom meeting – Creates a new Zoom meeting using the API.
-
List scheduled meetings – Displays the list of meetings scheduled under a specified Zoom user account.
- 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. - Download and install Ballerina Swan Lake.
- Download and install Docker.
Note: Ensure that the Docker daemon is running before executing any tests.
- Export Github Personal access token with read package permissions as follows,
export packageUser=<Username> export packagePAT=<Personal access token>
Execute the commands below to build from the source.
- To build the package:
./gradlew clean build
- To run the tests:
./gradlew clean test
- To build the without the tests:
./gradlew clean build -x test
- To run tests against different environments:
./gradlew clean test -Pgroups=<Comma separated groups/test cases>
- To debug the package with a remote debugger:
./gradlew clean build -Pdebug=<port>
- To debug with the Ballerina language:
./gradlew clean build -PbalJavaDebug=<port>
- Publish the generated artifacts to the local Ballerina Central repository:
./gradlew clean build -PpublishToLocalCentral=true
- Publish the generated artifacts to the Ballerina Central repository:
./gradlew clean build -PpublishToCentral=true
As an open-source project, Ballerina welcomes contributions from the community.
For more information, go to the contribution guidelines.
All the contributors are encouraged to read the Ballerina Code of Conduct.
- For more information go to the
zoom.meetings
package. - For example demonstrations of the usage, go to Ballerina By Examples.
- Chat live with us via our Discord server.
- Post all technical questions on Stack Overflow with the #ballerina tag.