Hi ,

I am facing issue while calling zoom api from drupal 7 custom module .

Actually there is some issue while calling zoom meetings api through DRUPAL 7 meeting gets created two times at one curl hit.

Below is the my curl code for calling zoom meeting API.

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.zoom.us/v2/users/$user_mail/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 => "{\"topic\":\"$topic\",\"type\":\"2\",\"start_time\":\"$start_time\",\"duration\":\"$duration\",\"timezone\":\"Asia/Calcutta\",\"password\":\"\",\"agenda\":\"\",\"settings\":{\"host_video\":false,\"participant_video\":false,\"cn_meeting\":false,\"in_meeting\":false,\"join_before_host\":false,\"mute_upon_entry\":false,\"watermark\":false,\"use_pmi\":false,\"approval_type\":2,\"registration_type\":1,\"audio\":\"$audio\",\"auto_recording\":\"none\",\"enforce_login\":true,\"enforce_login_domains\":\"\",\"alternative_hosts\":\"\"}}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer $token",
"content-type: application/json"
),
));

$response = curl_exec($curl);
// var_dump($response);
// die('test');

$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err; 
} else {

$result = json_decode($response,true);

print '<pre>'; print_r($result); print '</pre>';
}