Zoom Meeting Api is not implementing Meeting Start time correctly which i am passing to it in PHP

Description
When i am passing time to zoom api it does not schedule meeting on my mention time and in repsonse i am getting incorrect time which i have pass to api
I am passing the date time which is 2020-07-02 13:20:00 and time zone Asia/Tashkent here is the response which i am getting after passing mention time:-

stdClass Object
(
[uuid] => 4kQZhBwNRFWMXkzJ+04urQ==
[id] => 93304239122
[host_id] => DUwi9y_pQwaJjPV_y3ab1Q
[topic] => czdcadc
[type] => 2
[status] => waiting
[start_time] => 2020-07-02T03:20:00Z
[duration] => 60
[timezone] => Asia/Tashkent
[created_at] => 2020-06-30T06:54:25Z
[password] => 1aVYzX
[h323_password] => 731574
[pstn_password] => 731574
[encrypted_password] => NjIzQzR2bVBhR3o0NVZpRFBic21GZz09
[settings] => stdClass Object
(
[host_video] =>
[participant_video] =>
[cn_meeting] =>
[in_meeting] =>
[join_before_host] =>
[mute_upon_entry] =>
[watermark] =>
[use_pmi] =>
[approval_type] => 2
[audio] => voip
[auto_recording] => none
[enforce_login] =>
[enforce_login_domains] =>
[alternative_hosts] =>
[close_registration] =>
[registrants_confirmation_email] => 1
[waiting_room] => 1
[registrants_email_notification] => 1
[meeting_authentication] =>
)

)

Here is my code:
protected function sendRequest($data) {
$request_url = ‘https://api.zoom.us/v2/users/me/meetings’;
$headers = array(
"authorization: Bearer ".$this->generateJWTKey(),
‘content-type: application/json’
);
$postFields = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);
if(!$response){
return $err;
}
return json_decode($response);
}

//function to generate JWT
private function generateJWTKey() {
$key = $this->zoom_api_key;
$secret = $this->zoom_api_secret;
$token = array(
“iss” => $key,
“exp” => time() + 3600 //60 seconds as suggested
);
// $token = “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOm51bGwsImlzcyI6IlI1OWZNMEViUXFPcWNrU0c4dzR2MmciLCJleHAiOjE1OTA1MTM4NDUsImlhdCI6MTU5MDUwODQ0N30.4ch2OZoFM_vZFdqhoMzJX8r8GPYjKlOkV_vUa7LprFc”;
return JWT::encode( $token, $secret );
}

public function createAMeeting( $data = array() ) {
$post_time = $data[‘start_date’];
$start_time = gmdate( “Y-m-d\TH:i:s”, strtotime( $post_time ) );
$createAMeetingArray = array();
if ( ! empty( $data[‘alternative_host_ids’] ) ) {
if ( count( $data[‘alternative_host_ids’] ) > 1 ) {
$alternative_host_ids = implode( “,”, $data[‘alternative_host_ids’] );
} else {
$alternative_host_ids = $data[‘alternative_host_ids’][0];
}
}
$createAMeetingArray[‘topic’] = $data[‘meetingTopic’];
$createAMeetingArray[‘agenda’] = ! empty( $data[‘agenda’] ) ? $data[‘agenda’] : “”;
$createAMeetingArray[‘type’] = ! empty( $data[‘type’] ) ? $data[‘type’] : 2; //Scheduled
$createAMeetingArray[‘start_time’] = $start_time;
$createAMeetingArray[‘timezone’] = $data[‘timezone’];
$createAMeetingArray[‘password’] = ! empty( $data[‘password’] ) ? $data[‘password’] : “”;
$createAMeetingArray[‘duration’] = ! empty( $data[‘duration’] ) ? $data[‘duration’] : 60;
$createAMeetingArray[‘settings’] = array(
‘join_before_host’ => ! empty( $data[‘join_before_host’] ) ? true : false,
‘host_video’ => ! empty( $data[‘option_host_video’] ) ? true : false,
‘participant_video’ => ! empty( $data[‘option_participants_video’] ) ? true : false,
‘mute_upon_entry’ => ! empty( $data[‘option_mute_participants’] ) ? true : false,
‘enforce_login’ => ! empty( $data[‘option_enforce_login’] ) ? true : false,
‘auto_recording’ => ! empty( $data[‘option_auto_recording’] ) ? $data[‘option_auto_recording’] : “none”,
‘alternative_hosts’ => isset( $alternative_host_ids ) ? $alternative_host_ids : “”
);
return $this->sendRequest($createAMeetingArray);
}
This is the function which i am running to create meeting
function Hellozoom($title,$md,$mt,&$resp=array()){
try{

$z = $this->createAMeeting(
array(
‘start_date’=>date(“Y-m-d H:i:s”, strtotime($md." ".$mt)),
‘meetingTopic’=>$title,
‘timezone’=>‘Asia/Tashkent’
)
);
$resp=$z;
//print_r($z);
} catch (Exception $ex) {
echo $ex;
}
}

Infront of gmdate() function just use date() function and pass parameter it will work perfectly…

1 Like

But i am getting different times on zoom account and response
Here is my correct time 3:26 pm which is also showing same from zoom api response
It is bold one
{

* "uuid":"q1PC+bqWRLCtiP19mPVYVw==",
* "id":99119947595,
* "host_id":"DUwi9y_pQwaJjPV_y3ab1Q",
* "topic":"some assets",
* "type":2,
* "status":"waiting",
 **"start_time":"2020-07-08T15:26:00Z",**
* "duration":60,
* "timezone":"Asia/Tashkent",
* "created_at":"2020-06-30T10:28:45Z",
* "start_url":"https://zoom.us/s/99119947595?zak=eyJ6bV9za20iOiJ6bV9vMm0iLCJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjbGllbnQiLCJ1aWQiOiJEVXdpOXlfcFF3YUpqUFZfeTNhYjFRIiwiaXNzIjoid2ViIiwic3R5IjoxMDAsIndjZCI6ImF3MSIsImNsdCI6MCwic3RrIjoiMUJ1MW1NSU1YbV81SEMtSHVILXdIN0w0SFQteTZmUEZMSmwzeF9TM2I4MC5CZ1VzTnpKelYycE5VazlYWm14NGRFeG9kV0Z0VlVKRlREQmxhMUJ2YUc5UlpIY3dTRUZWYkVnclRUQnliejFBWVdJME9ERmxOREprTURSaU16RTRZamsxT1RobVpEUXlZV0k1T1RZME1XWTROemt6WlRrMFpEVTVPVEJpTnpreE9EVTBZekkyTWpnNE9UbGtNemcxTXdBTU0wTkNRWFZ2YVZsVE0zTTlBQU5oZHpFIiwiZXhwIjoxNTkzNTIwMTI2LCJpYXQiOjE1OTM1MTI5MjYsImFpZCI6InlNSVhIeUNCU25xVkEwMXBhWml2cFEiLCJjaWQiOiIifQ.2TPyAiITCRjwVt0rsLP54Dx5p1lC03bTCGuDPUI2iLY",
* "join_url":"https://zoom.us/j/99119947595?pwd=dmNmclU0YTFtdm1zdWRRV1ZNWUl2QT09",
* "password":"8HkrzC",
* "h323_password":"508432",
* "pstn_password":"508432",
* "encrypted_password":"dmNmclU0YTFtdm1zdWRRV1ZNWUl2QT09",
* "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,
  * "audio":"voip",
  * "auto_recording":"none",
  * "enforce_login":false,
  * "enforce_login_domains":"",
  * "alternative_hosts":"",
  * "close_registration":false,
  * "registrants_confirmation_email":true,
  * "waiting_room":true,
  * "registrants_email_notification":true,
  * "meeting_authentication":false}

}

Blockquote

But On Zoom Account

Hey @abdullah,

If you are including the Z in the start_time, it will be sent with GMT time and not your timezone. Try removing the Z.

Thanks,
Tommy