Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Overview
[Zoom](https://www.zoom.com/) 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 (https://developers.zoom.us/docs/api/meetings/).
The `ballerinax/zoom.meetings` package offers APIs to connect and interact with Zoom API endpoints, specifically based on [Zoom API v2](https://developers.zoom.us/docs/api/meetings/).

## Setup guide

Expand Down Expand Up @@ -37,22 +37,22 @@ To use the Zoom meetings connector, you must have access to the Zoom API through

2. **Set Redirect URI**: Add your application's 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
3. **Add scopes**: Make sure your Zoom app has the necessary scopes for the meetings API:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. **Add scopes**: Make sure your Zoom app has the necessary scopes for the meetings API:
3. **Add scopes:** Make sure your Zoom app has the necessary scopes for the meetings API:

* Add `meetings:read`, `meetings:write` and `user:read` in the scope

![App Scopes](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-zoom.meetings/refs/heads/main/docs/setup/resources/app-scopes.png)

### Step 3: Activate the App
### Step 3: Activate the app

1. Complete all necessary information fields.

2. Once, the necessary fields are correctly filled, app will be activated.

### Step 4: Get User Authorization
### 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
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
```

2. **User authorizes the app** and gets redirected to your callback URL with an authorization code
Expand All @@ -72,7 +72,7 @@ To use the Zoom meetings connector, you must have access to the Zoom API through
* `AUTHORIZATION_CODE` with the code received from the callback
* `YOUR_REDIRECT_URI` with your configured redirect URI

### Step 5: Verify Your Setup
### Step 5: Verify your setup
```curl
curl -X GET "https://api.zoom.us/v2/users/me" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Expand All @@ -99,7 +99,7 @@ To use the `Zoom` connector in your Ballerina application, update the `.bal` fil
```bash
refreshToken = "<refresh Token>"
refreshUrl = "<refresh URL>"
userId="<user_id>"
userId = "<user_id>"
clientId = "<client_id>"
clientSecret = "<client_secret>"
```
Expand Down
16 changes: 8 additions & 8 deletions ballerina/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Overview
[Zoom](https://www.zoom.com/) 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 (https://developers.zoom.us/docs/api/meetings/).
The `ballerinax/zoom.meetings` package offers APIs to connect and interact with Zoom API endpoints, specifically based on [Zoom API v2](https://developers.zoom.us/docs/api/meetings/).

## Setup guide

Expand Down Expand Up @@ -31,22 +31,22 @@ To use the Zoom meetings connector, you must have access to the Zoom API through

2. **Set Redirect URI**: Add your application's 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
3. **Add scopes**: Make sure your Zoom app has the necessary scopes for the Meetings API:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. **Add scopes**: Make sure your Zoom app has the necessary scopes for the Meetings API:
3. **Add scopes:** Make sure your Zoom app has the necessary scopes for the Meetings API:

* Add `meetings:read`, `meetings:write` and `user:read` in the scope

![App Scopes](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-zoom.meetings/refs/heads/main/docs/setup/resources/app-scopes.png)

### Step 3: Activate the App
### Step 3: Activate the app

1. Complete all necessary information fields.

2. Once, the necessary fields are correctly filled, app will be activated.

### Step 4: Get User Authorization
### 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
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
```

2. **User authorizes the app** and gets redirected to your callback URL with an authorization code
Expand All @@ -66,7 +66,7 @@ To use the Zoom meetings connector, you must have access to the Zoom API through
* `AUTHORIZATION_CODE` with the code received from the callback
* `YOUR_REDIRECT_URI` with your configured redirect URI

### Step 5: Verify Your Setup
### Step 5: Verify your setup
```curl
curl -X GET "https://api.zoom.us/v2/users/me" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Expand All @@ -93,7 +93,7 @@ To use the `Zoom` connector in your Ballerina application, update the `.bal` fil
```bash
refreshToken = "<refresh Token>"
refreshUrl = "<refresh URL>"
userId="<user_id>"
userId = "<user_id>"
clientId = "<client_id>"
clientSecret = "<client_secret>"
```
Expand Down
16 changes: 8 additions & 8 deletions ballerina/tests/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Running Tests
# Running tests

## Prerequisites
You need a Access token from Zoom developer account.
Expand All @@ -11,32 +11,32 @@ curl -X GET "https://api.zoom.us/v2/users/me" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

# Running Tests
# Running tests

There are two test environments for running the Zoom connector tests. The default test environment is the mock server for Zoom API. The other test environment is the actual Zoom API.

You can run the tests in either of these environments and each has its own compatible set of tests.

Test Groups | Environment
-------------|---------------------------------------------------
mock_tests | Mock server for Zoom API (Defualt Environment)
mock_tests | Mock server for Zoom API (Default Environment)
live_tests | Zoom API

## Running Tests in the Mock Server
## Running tests in the mock server

To execute the tests on the mock server, ensure that the `IS_LIVE_SERVER` environment variable is either set to `false` or unset before initiating the tests.

This environment variable can be configured within the `Config.toml` file located in the tests directory or specified as an environmental variable.

#### Using a Config.toml File
#### Using a Config.toml file

Create a `Config.toml` file in the tests directory and the following content:

```toml
isLiveServer = false
```

#### Using Environment Variables
#### Using environment variables

Alternatively, you can set your authentication credentials as environment variables:
If you are using linux or mac, you can use following method:
Expand All @@ -53,7 +53,7 @@ Then, run the following command to run the tests:
./gradlew clean test
```

## Running Tests Against Zoom Live API
## Running tests against Zoom Live API

#### Using a Config.toml File

Expand All @@ -68,7 +68,7 @@ Create a `Config.toml` file in the tests directory and add your authentication c
userId = "user_id_from_step5"
```

#### Using Environment Variables
#### Using environment variables

Alternatively, you can set your authentication credentials as environment variables:
If you are using linux or mac, you can use following method:
Expand Down
7 changes: 4 additions & 3 deletions ballerina/tests/tests.bal
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ConnectionConfig config = isLiveServer

final Client zoomClient = check new Client(config, serviceUrl);

int meetingId = 87163296266;
int meetingId = 81835795193;

@test:Config {
groups: ["live_tests", "mock_tests"]
Expand Down Expand Up @@ -86,7 +86,7 @@ function testGetMeeting() returns error? {
dependsOn: [testCreateMeeting]
}
function testUpdateMeeting() returns error? {
error? response = zoomClient->/meetings/[meetingId].patch(
check zoomClient->/meetings/[meetingId].patch(
payload = {
topic: "Updated New Meeting",
startTime: "2025-09-01T15:05:00Z"
Expand All @@ -101,7 +101,7 @@ function testUpdateMeeting() returns error? {
dependsOn: [testCreateMeeting, testUpdateMeeting, testGetMeeting, testGetMeetingInvitation]
}
function testDeleteMeeting() returns error? {
error? response = zoomClient->/meetings/[meetingId].delete();
check zoomClient->/meetings/[meetingId].delete();
}

@test:Config {
Expand All @@ -110,6 +110,7 @@ function testDeleteMeeting() returns error? {
}
function testGetMeetingInvitation() returns error? {
MeetingInvitation response = check zoomClient->/meetings/[meetingId]/invitation();
test:assertTrue(response.invitation != "", msg = "Invitation should not be empty");
}

@test:Config {
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The `ballerinax/zoom.meetings` connector provides practical examples illustratin
```bash
refreshToken = "<refresh Token>"
refreshUrl = "<refresh URL>"
userId="<user_id>"
userId = "<user_id>"
clientId = "<client_id>"
clientSecret = "<client_secret>"
```
Expand Down
4 changes: 2 additions & 2 deletions examples/create-new-meeting/create-new-meeting.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Zoom Meetings - Create a Meeting
# Zoom Meetings - Create a meeting

This example demonstrates how the **Zoom Meetings API** can be used to **create a Zoom meeting** programmatically. This is helpful for automating internal scheduling, setting up webinars, or integrating with external systems such as CRMs or helpdesks.

Expand All @@ -15,7 +15,7 @@ Create a `Config.toml` file in the example's root directory and, provide your Zo
```bash
refreshToken = "<refresh Token>"
refreshUrl = "<refresh URL>"
userId="<user_id>"
userId = "<user_id>"
clientId = "<client_id>"
clientSecret = "<client_secret>"
```
Expand Down
4 changes: 2 additions & 2 deletions examples/list-all-meetings/list-all-meetings.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Zoom Meetings - List all Meetings
# Zoom Meetings - List all meetings

This example demonstrates how to **retrieve and list all Zoom meetings** for a given user using the Zoom Meetings API. This is useful for displaying scheduled meetings, integrating with dashboards, or building internal tools for scheduling visibility.

Expand All @@ -15,7 +15,7 @@ Create a `Config.toml` file in the example's root directory and, provide your Zo
```bash
refreshToken = "<refresh Token>"
refreshUrl = "<refresh URL>"
userId="<user_id>"
userId = "<user_id>"
clientId = "<client_id>"
clientSecret = "<client_secret>"
```
Expand Down
15 changes: 15 additions & 0 deletions examples/list-all-meetings/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ public function main() returns error? {
io:println("-------------------------------");
}
}
meetings:InlineResponse20028Meetings firstMeeting = meetings[0];
int meetingId = <int>firstMeeting.id;
error? updateResult = zoomClient->/meetings/[meetingId].patch(
payload = {
topic: "Updated Topic via Test Ballerina",
startTime: "2025-09-01T15:05:00Z"
}
);
if updateResult is error {
io:println("Failed to update meeting: ", updateResult.message());
} else {
io:println("Meeting ", meetingId, " successfully updated.");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error? updateResult = zoomClient->/meetings/[meetingId].patch(
payload = {
topic: "Updated Topic via Test Ballerina",
startTime: "2025-09-01T15:05:00Z"
}
);
if updateResult is error {
io:println("Failed to update meeting: ", updateResult.message());
} else {
io:println("Meeting ", meetingId, " successfully updated.");
}
check zoomClient->/meetings/[meetingId].patch({
topic: "Updated Topic via Test Ballerina",
startTime: "2025-09-01T15:05:00Z"
});
io:println("Meeting ", meetingId, " successfully updated.");

We can use a check expression and remove the if statements here..

meetings:InlineResponse20013 updatedMeeting = check zoomClient->/meetings/[meetingId]();
io:println("Updated Topic: ", updatedMeeting.topic);
}


Loading