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] =>
[id] => ***********
[host_id] =>
[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] =>
[h323_password] =>
[pstn_password] =>
[encrypted_password] =>
[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 = “”;
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;
}
}

*This post has been edited to remove any meeting / webinar IDs

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":",
* "id":***********,
* "host_id":"",
* "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":"",
* "join_url":"",
* "password":"",
* "h323_password":"",
* "pstn_password":"",
* "encrypted_password":"",
* "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

*This post has been edited to remove any meeting / webinar IDs

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

I have send the Body text like,
{
“topic”: “Demo on 26th”,
“Type”: 2,
“Start_Time”: “2020-08-25T10:00:00”,
“Duration”: 30,
“Timezone”: “”,
“Password”: “”,
“Recurrence”: {
“Type”: 1,
“Repeat_Interval”: 1,
“Weekly_Days”: 2,
“Monthly_Day”: 1,
“Monthly_Week”: 1,
“Monthly_Week_Day”: 2,
“End_Times”: 1,
“End_Date_Time”: “2040-12-31T23:59:59”
},
“Settings”: {
“AlternativeHosts”: “”,
“Approval_Type”: 2,
“Audio”: “both”,
“Auto_Recording”: “cloud”,
“Close_Registration”: false,
“Cn_Meeting”: false,
“Enforce_Login”: false,
“Enforce_Login_Domains”: “”,
“Global_Dial_In_Countries”: [
“US”
],
“Global_Dial_In_Numbers”: ,
“Host_Video”: true,
“In_Meeting”: false,
“Join_Before_Host”: true,
“Mute_Upon_Entry”: false,
“End_Date_Time”: null,
“Participant_Video”: true,
“Registrants_Confirmation_Email”: true,
“Use_Pmi”: false,
“Waiting_Room”: false,
“Watermark”: false,
“Registrants_Email_Notification”: true
}
}
and got current UTC time as start time in response.

{
“created_at”: “2020-08-26T04:16:40Z”,
“duration”: 60,
“host_email”: “”,
“host_id”: “”,
“id”: ***********,
“join_url”: “”,
“settings”: {
“alternative_hosts”: “”,
“approval_type”: 2,
“audio”: “both”,
“auto_recording”: “none”,
“close_registration”: false,
“cn_meeting”: false,
“enforce_login”: false,
“enforce_login_domains”: “”,
“global_dial_in_countries”: [
“US”
],
“global_dial_in_numbers”: [
{
“country”: “US”,
“country_name”: “US”,
“number”: “+1 3126266799”,
“type”: “toll”
},
{
“country”: “US”,
“country_name”: “US”,
“number”: “+1 9292056099”,
“type”: “toll”
},
{
“country”: “US”,
“country_name”: “US”,
“number”: “+1 3017158592”,
“type”: “toll”
},
{
“country”: “US”,
“country_name”: “US”,
“number”: “+1 3462487799”,
“type”: “toll”
},
{
“country”: “US”,
“country_name”: “US”,
“number”: “+1 6699006833”,
“type”: “toll”
},
{
“country”: “US”,
“country_name”: “US”,
“number”: “+1 2532158782”,
“type”: “toll”
}
],
“host_video”: false,
“in_meeting”: false,
“join_before_host”: false,
“meeting_authentication”: false,
“mute_upon_entry”: false,
“participant_video”: false,
“registrants_confirmation_email”: true,
“registrants_email_notification”: true,
“request_permission_to_unmute_participants”: false,
“use_pmi”: false,
“waiting_room”: true,
“watermark”: false
},
“start_time”: “2020-08-26T04:16:40Z”,
“start_url”: “”,
“status”: “waiting”,
“timezone”: “UTC”,
“topic”: “Demo on 26th”,
“type”: 2,
“uuid”: “”
}

URL: https://api.zoom.us/v2/users/{userId}/meetings
user_id:

*This post has been edited to remove any meeting / webinar IDs

Hey @swamivenkat,

I have replied to you here:

Thanks,
Tommy

UTC time like this, won’t work within API:
2020-11-27T00:00:00Z

Hi @xiaotu,

Can you share the full request body you’re sending and the response with any errors? This will help to debug.

Thanks,
Will

Hello Tommy,

We are not using Z. but we are getting the same issue.

Hi @pankaj.sharma2089,

Can you please share the full request body JSON that you’re using and the response you’re getting? This will help us to take a closer look.

Thanks,
Will

Hi Will,

Since yesterday I am facing the same issue, before that it was working for me, getting ‘Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again.’ error while trying to join/host a meeting using web-sdk.
I am creating meetingRoom from zoom create meeting api and then trying to enter meeting from web-sdk.
Let me know if you need more info on the same, I am continuously facing the issue for all meetings.

this is one of the config for which it failed:

  • We use SDK 1.7.8
  • Developer account is not pro
  • Key/secret is JWT API
  • Error showing all meetings

SDK JOIN MEETING CODE

ZoomMtg.preLoadWasm();

ZoomMtg.prepareJssdk();

var meetConfig = {

    apiKey: "<?php echo ZOOM_API_KEY ?>",

    apiSecret: "<?php echo ZOOM_API_SECRET ?>",

    meetingNumber: "<?php echo $meetingID; ?>",

    userName: "<?php echo $name;?>",

    passWord: "<?php echo $class_rooms->room_password;?>",

    leaveUrl: "<?php echo '/onlineclasses/' ;?>",

    role: <?php echo $usertype == 'Student'?0:1; ?>

};

var signature = ZoomMtg.generateSignature({

    meetingNumber: meetConfig.meetingNumber,

    apiKey: meetConfig.apiKey,

    apiSecret: meetConfig.apiSecret,

    role: meetConfig.role,

    success: function(res){

        console.log(res.result);

    }

});

ZoomMtg.init({

    leaveUrl: meetConfig.leaveUrl,

    isSupportAV: true,

    success: function () {

        ZoomMtg.join(

            {

                meetingNumber: meetConfig.meetingNumber,

                userName: meetConfig.userName,

                signature: signature,

                apiKey: meetConfig.apiKey,

                passWord: meetConfig.passWord,

                success: function(res){

                    $('.header, .main-footer').remove();

                },

                error: function(res) {

                    console.log(res);

                }

            }

        );

    },

    error: function(res) {

        console.log(res);

    }

});

Please help me. It’s very urgent. Because my app is live and online classes will be already started.

Thank You

Hi @pankaj.sharma2089 ,

Since this is more related to our Web SDK, please create a new topic here: #client-web-sdk

In the meantime, please ensure the credentials you’re using to generate your signature belong to a Pro account.

Thank you,
Will