diff --git a/README.md b/README.md index c5d01bc..b69d3d2 100644 --- a/README.md +++ b/README.md @@ -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 @@ -29,35 +29,35 @@ To use the Zoom meetings connector, you must have access to the Zoom API through ### Step 2: Configure OAuth settings - 1. **Note down your credentials**: + 1. **Note down your credentials:** * Client ID * Client Secret ![App Credentials](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-zoom.meetings/refs/heads/main/docs/setup/resources/app-credentials.png) - 2. **Set Redirect URI**: Add your application's redirect URI + 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: + * 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 - 3. **Exchange authorization code for tokens**: + 3. **Exchange authorization code for tokens:** ```curl curl -X POST https://zoom.us/oauth/token \ -H "Authorization: Basic $(echo -n 'CLIENT_ID:CLIENT_SECRET' | base64)" \ @@ -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" @@ -99,7 +99,7 @@ To use the `Zoom` connector in your Ballerina application, update the `.bal` fil ```bash refreshToken = "" refreshUrl = "" - userId="" + userId = "" clientId = "" clientSecret = "" ``` diff --git a/ballerina/README.md b/ballerina/README.md index f476c9b..cc710b8 100644 --- a/ballerina/README.md +++ b/ballerina/README.md @@ -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 @@ -23,35 +23,35 @@ To use the Zoom meetings connector, you must have access to the Zoom API through ### Step 2: Configure OAuth settings - 1. **Note down your credentials**: + 1. **Note down your credentials:** * Client ID * Client Secret ![App Credentials](https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-zoom.meetings/refs/heads/main/docs/setup/resources/app-credentials.png) - 2. **Set Redirect URI**: Add your application's redirect URI + 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: + * 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 - 3. **Exchange authorization code for tokens**: + 3. **Exchange authorization code for tokens:** ```curl curl -X POST https://zoom.us/oauth/token \ -H "Authorization: Basic $(echo -n 'CLIENT_ID:CLIENT_SECRET' | base64)" \ @@ -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" @@ -93,7 +93,7 @@ To use the `Zoom` connector in your Ballerina application, update the `.bal` fil ```bash refreshToken = "" refreshUrl = "" - userId="" + userId = "" clientId = "" clientSecret = "" ``` diff --git a/ballerina/tests/README.md b/ballerina/tests/README.md index fe52253..7dbeeab 100644 --- a/ballerina/tests/README.md +++ b/ballerina/tests/README.md @@ -1,4 +1,4 @@ -# Running Tests +# Running tests ## Prerequisites You need a Access token from Zoom developer account. @@ -11,7 +11,7 @@ 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. @@ -19,16 +19,16 @@ You can run the tests in either of these environments and each has its own compa 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: @@ -36,7 +36,7 @@ Create a `Config.toml` file in the tests directory and the following content: 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: @@ -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 @@ -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: diff --git a/ballerina/tests/tests.bal b/ballerina/tests/tests.bal index a064bb3..d11f5e4 100644 --- a/ballerina/tests/tests.bal +++ b/ballerina/tests/tests.bal @@ -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"] @@ -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" @@ -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 { @@ -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 { diff --git a/examples/README.md b/examples/README.md index f1b7ec6..c97151e 100644 --- a/examples/README.md +++ b/examples/README.md @@ -16,7 +16,7 @@ The `ballerinax/zoom.meetings` connector provides practical examples illustratin ```bash refreshToken = "" refreshUrl = "" - userId="" + userId = "" clientId = "" clientSecret = "" ``` diff --git a/examples/create-new-meeting/create-new-meeting.md b/examples/create-new-meeting/create-new-meeting.md index bc364b7..f274dc4 100644 --- a/examples/create-new-meeting/create-new-meeting.md +++ b/examples/create-new-meeting/create-new-meeting.md @@ -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. @@ -15,7 +15,7 @@ Create a `Config.toml` file in the example's root directory and, provide your Zo ```bash refreshToken = "" refreshUrl = "" -userId="" +userId = "" clientId = "" clientSecret = "" ``` diff --git a/examples/list-all-meetings/list-all-meetings.md b/examples/list-all-meetings/list-all-meetings.md index fced7e9..bf13cf2 100644 --- a/examples/list-all-meetings/list-all-meetings.md +++ b/examples/list-all-meetings/list-all-meetings.md @@ -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. @@ -15,7 +15,7 @@ Create a `Config.toml` file in the example's root directory and, provide your Zo ```bash refreshToken = "" refreshUrl = "" -userId="" +userId = "" clientId = "" clientSecret = "" ``` diff --git a/examples/list-all-meetings/main.bal b/examples/list-all-meetings/main.bal index 4329dc2..67433a1 100644 --- a/examples/list-all-meetings/main.bal +++ b/examples/list-all-meetings/main.bal @@ -46,6 +46,16 @@ public function main() returns error? { io:println("-------------------------------"); } } + meetings:InlineResponse20028Meetings firstMeeting = meetings[0]; + int meetingId = firstMeeting.id; + check zoomClient->/meetings/[meetingId].patch({ + topic: "Updated Internship Topic via Test Ballerina", + startTime: "2025-09-01T15:05:00Z" + } + ); + io:println("Meeting ", meetingId, " successfully updated."); + meetings:InlineResponse20013 updatedMeeting = check zoomClient->/meetings/[meetingId](); + io:println("Updated Topic: ", updatedMeeting.topic); }