Here is the code which we are using to create a metting. But when join as participant it shows message that waiting for host to start the meeting but we wanted anyone can start the meeting.
// Define the API endpoint to create a meeting
$apiEndpoint = 'https://api.zoom.us/v2/users/14V4eKRwQ8ubhKkzgfwetA/meetings';
// Define the meeting data
$meetingData = [
'topic' => 'Sample Meeting',
'type' => 2, // 2 for a scheduled meeting
'start_time' => '2023-09-25T14:00:00Z', // Set your desired start time in UTC
'duration' => 60, // Meeting duration in minutes
'settings' => array(
'join_before_host' => true,
'use_pmi' => false,
'approval_type' => 2,
'audio' => 'voip',
'auto_recording' => 'none',
'enforce_login' => false
),
'timezone' => 'UTC',
];
$tokenData = getAccessToken();
if (isset($tokenData)) {
// Use the access token to create a meeting
$meetingHeaders = [
'Authorization' => 'Bearer ' . $tokenData,
'Content-Type' => 'application/json',
];
$meetingClient = new Client();
$meetingResponse = $meetingClient->post($apiEndpoint, [
'headers' => $meetingHeaders,
'json' => $meetingData,
]);
$meetingResult = json_decode($meetingResponse->getBody(), true);
echo '<pre>'; print_r($meetingResult); echo '</pre>';
if (isset($meetingResult['id'])) {
echo 'Meeting created successfully. Meeting ID: ' . $meetingResult['id'];
} else {
echo 'Error creating meeting: ' . json_encode($meetingResult);
}
} else {
echo 'Error obtaining access token: ' . json_encode($tokenData);
}