I have created two apps, one is OAuth type and the other is JWT. I am using the following php code to create a meeting.
$zoomData = ‘{
“topic”: “API Test”,
“type”: 2,
“start_time”: “2020-04-09T12:02:00”,
“duration”: “60”,
“timezone”: “Pacific/Auckland”,
“password”: “1234”,
“agenda”: “This is a test meeting”,
“settings”: {
“host_video”: true,
“participant_video”: true,
“audio”: “voip”,
“waiting_room”: true
}
}’;
$clientID=“XXXXXXXXXXXXXXXX”;
$clientSecret=“XXXXXXXXXXXXX”;
$content =“grant_type=client_credentials&client_id=$clientID&client_secret=$clientSecret”;
$token_url=“https://zoom.us/oauth/token”;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $token_url,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $content
));
$token = curl_exec($curl);
$zoomData = json_encode($zoomData);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “https://api.zoom.us/v2/users/MYACCOUNTID/meetings”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => $zoomData,
CURLOPT_HTTPHEADER => array(“Content-Type: application/json”, "Authorization: Bearer " . json_decode($token)),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo “cURL Error #:” . $err;
} else {
echo $response;
}
I would much prefer to use the JWT app because it seems simpler but I can’t figure out how to code it because I have found no examples anywhere. We want to be able to automatically create zoom meetings via our Wordpress site when someone orders a product.
Any help would be appreciated. Maybe it is something basic I am missing.
Carl