How to Add Waiting Room and Set the Meeting as Recurrence Meeting - Zoom API

I use Zoom API to create a meeting on my Employee Management System that I created. I’m planning to add a recurrence meeting, and a waiting room. This is my code, here I’m using OAuth

<?php
require_once 'config.php';

function create_meeting($nama_event, $start_time, $password) {
$client = new GuzzleHttp\Client(['base_uri' => 'https://api.zoom.us']);

$db = new DB();
$arr_token = $db->get_access_token();
$accessToken = $arr_token->access_token;

try {
    $response = $client->request('POST', '/v2/users/me/meetings', [
        "headers" => [
            "Authorization" => "Bearer $accessToken"
        ],
        'json' => [
            "topic" => "$nama_event",
            "start_time" => "$start_time",
            "timezone" => "Asia/Jakarta",
            "waiting_room" => true,
            "password" => "123456",
            "recurrence" => [
                "end_date_time" => "2022-04-02T15:59:00Z",
                "end_times" => 7,
                "monthly_day" => 1,
                "monthly_week" => 1,
                "monthly_week_day" => 1,
                "repeat_interval" => 1,
                "type" => 2,
                "weekly_days" => "1"
            ]
        ],
    ]);

    $data = json_decode($response->getBody());
    return $data;
    // echo "Join URL: ". $data->join_url;
    // echo "<br>";
    // echo "Meeting Password: ". $data->password;

} catch(Exception $e) {
    if( 401 == $e->getCode() ) {
        $refresh_token = $db->get_refersh_token();

        $client = new GuzzleHttp\Client(['base_uri' => 'https://zoom.us']);
        $response = $client->request('POST', '/oauth/token', [
            "headers" => [
                "Authorization" => "Basic ". base64_encode(CLIENT_ID.':'.CLIENT_SECRET)
            ],
            'form_params' => [
                "grant_type" => "refresh_token",
                "refresh_token" => $refresh_token
            ],
        ]);
        $db->update_access_token($response->getBody());
        create_meeting($nama_event, $start_time, $password);
    } else {
        echo $e->getMessage();
    }
  }
}

To add a waiting room and set a meeting as a recurrence meeting using the Zoom API, you can make use of the Zoom REST API endpoints. Below are the steps you can follow:

Obtain API credentials: Before using the Zoom API[,](https://youtubevanced.org) you'll need to have API credentials. If you haven't already done so, sign up for a Zoom Developer account at the Zoom App Marketplace (https://marketplace.zoom.us/) and create an API app to obtain the required credentials.

Authorize your application: Once you have the API credentials, you need to authorize your application to access the Zoom API. You can refer to the Zoom API documentation for details on the authorization process.

Create a recurring meeting: To create a recurring meeting, make a POST request to the /users/{userId}/meetings endpoint. Replace {userId} with the user ID or email of the user who will host the meeting. In the request body, include the necessary parameters like topic, type, start_time, duration, and recurrence.

Here's an example request body in JSON format to create a recurring meeting:

json

{
  "topic": "My Recurring Meeting",
  "type": 2,
  "start_time": "2023-05-15T10:00:00Z",
  "duration": 60,
  "recurrence": {
    "type": 2,
    "repeat_interval": 1,
    "weekly_days": "1",
    "end_date_time": "2023-06-30T00:00:00Z"
  },
  "settings": {
    "waiting_room": true
  }
}

Adjust the parameters according to your requirements. In the example above, the meeting is set to recur weekly on Mondays ("weekly_days": "1") and has a waiting room enabled ("waiting_room": true).

Handle the API response: The API will respond with the details of the created meeting, including the meeting ID, join URL, and other relevant information. Make sure to handle the response appropriately in your application.

That’s it! You have now created a recurring meeting with a waiting room using the Zoom API. Remember to handle any errors and implement error-checking as per the API documentation to ensure a smooth integration. For more information on the Zoom API and its endpoints, you can refer to the official Zoom API documentation available at https://marketplace.zoom.us/docs/api-reference/introduction.