Zoom meeting Api call

Hi @Ojus,

How can we get the start time in this format “Sep 20, 2019 10:00 PM Brisbane” in the api
response ?

Thanks,
Donna

Hey @dmortlock,

The start_time returned from the GET meetings endpoint will be what time/timezone you set. You can specify UTC/GMT or a local time with a timezone.

It is up to your app to format the date differently and convert to the local timezone.

For example in JavaScript you can use the moment.js module to easily convert timezones and date formats.

Let me know if you have more questions or if I missed anything!

Thanks,
Tommy

Hi @tommy,

Thanks for your assistance.

Thanks,
Donna

Hi @tommy,

I’m facing issue with th zoom meeting api.

Api endpoint : https://api.zoom.us/v2/users/H-QLEjGdR3GFwA87WTKmKw/meetings!

As sometime I get the response but sometime I didn’t get the response.

But zoom meeting is creating every time as I can see in the zoom account or the api log.

Need some assistance as I’m facing this for so long and didn’t any solutions yet .

For your reference please find the attached screenshot below:

Thanks,
Donna

Hey @dmortlock, happy to help :slight_smile:

What do you mean you are getting no response?

Is the response empty? What is the status code? Are there any errors?

Thanks,
Tommy

Hi @tommy,

Thanks for your quick response.

I am getting no response sometimes no any errors in my system when calling zoom meeting api.

But meetings are created for those api calls also getting response with status code 201 in the api log.

Thanks,
Donna

So the request is hanging when you POST https://api.zoom.us/v2/users/H-QLEjGdR3GFwA87WTKmKw/meetings?

Can you provide your full request url and body? Also are you using JWT or OAuth app?

Thanks,
Tommy

Below is the request body that I’m using for zoom api call.

function customZoom_webform_submission_insert($node, $submission) {

module_load_include('inc', 'webform', 'includes/webform.submissions');
$submissions = webform_get_submissions(array('nid'=> 34501));
$timeData = [];
foreach ($submissions as $submission){
    
    foreach ($submission->data as $row=>$data){
        
          $timeData[$submission->sid][$row] = $data[0];
        

    }
      foreach ($timeData as $value) {
        # code...

        $topic = $value['1'];
        $type = 2;
        $date = $value['2'];
        $time = $value['3'];
        $start_time = $date."T".$time;
        $duration = $value['9'];
        $userid = $value['10'];
        $timezone = $value['5'];
        $host_video = $value['6'];
        $participant_video = $value['7'];
        $audio = $value['8'];

      }
}

if (isset($_SESSION["counter"]) && $_SESSION["counter"] > 0 ){
    
   unset($_SESSION["counter"]);
  }else{
    $_SESSION["counter"] = 1;
    
  $key = "{{ key }}";
  $payload = array(
      "iss" => "CDfctbTdRk6kQFLFFb32pw",
      "iat" => time(),
      "exp" => time()+5000
  );

  $token = JWT::encode($payload, $key);

  $curl = curl_init();
  $post_data  = array(
    'topic' =>$topic,
    'type'  => 2,
    'start_time'=>$start_time,
    'duration'=>$duration,
    'timezone'=>$timezone,
    'password'=>"{{ password }}",
    'agenda'=>"",
    'settings'=>array(
                 'host_video'=>$host_video,
                 'participant_video'=>$participant_video,
                 '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'=>""
                )
  ); 

  curl_setopt_array($curl, array(
    CURLOPT_URL => "https://api.zoom.us/v2/users/$userid/meetings",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 1000,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => json_encode($post_data),
    CURLOPT_HTTPHEADER => array(
      "authorization: Bearer $token",
      "content-type: application/json"
    ),
  ));
  $res1 = curl_exec($curl);
  //print_r($res1);
  //die('test');
 
  $err = curl_error($curl);

  curl_close($curl);    

      if ($err) {
        echo "cURL Error #:" . $err;  
      } else {
      
    $result1 = json_decode($res1,true);

    $output = array(
    '#theme' => 'customZoom_create_meetings_template',
    '#type' => 'markup',
    '#result1'=>$result1,
    );
    return $output;
     
      }
  }

Also I’m using JWT .

Below is the code that I’m using in the success page.

<?php
if (isset($result1['host_id']) && !empty($result1['host_id'])) :?>	
<p><?php  print "You have successfully created the zoom meeting.";?></p>
<?php else: ?>
<?php echo "<h2>"."Meeting not created ."."</h2>";?>
<?php endif; ?>

Hey @dmortlock,

What percentage of the time do you get no response?

Also can you share one of the responses you do get?

Thanks,
Tommy

Hi @tommy,

I get the response sometime or sometime not it’s not certain.

I have shared the screenshot above for the response that I can see in the api log.

Thanks,
Donna

Hi @tommy,

As you can see I didn’t get the response for this api call success page is blank with no error code but the zoom meeting is created with the topic zoom test.

For your reference I have attached the screenshot below:

Thanks,
Donna

Thanks Donna, to figure out whether this is a bug with your code, or Zooms response not coming back, can you look in the network tab in the browsers console to see if you are getting a response?

If you don’t know how to see responses in the network tab, here are instructions.

Thanks,
Tommy

Hi @tommy,

Thanks for your reply.

Yes I have checked that I’m not getting the responses in the network tab as well when I’m getting the
success page blank as explained you above.

Thanks,
Donna

Hey @dmortlock,

Can you schedule a time to join a Zoom Meeting so I can better assist?

Thanks,
Tommy

Hi @tommy,

Thanks for your assistance .

I will debug the issue today with error_log() function check out the error messages in the log file .

can we reschedule the zoom meeting on monday?

Thanks,
Donna

Hi @tommy,

I have checked with the error_log() function still not showing any errors in the log file .

Thanks,
Donna

Hey @dmortlock,

If you see the response here https://marketplace.zoom.us/user/logs then the call and response were successful. Double check your codes logic to make sure it is handling the response correctly. Unfortunately since this is not a Zoom issue, we can’t debug your code.

This might help:

Thanks,
Tommy

Hi all,
I guess it might be due to the timezone as I’m in india and I was creating meeting for the Asia/kolkata But whenever I’m creating the meetings for the next day or specific day here response is coming as well as current date and time,please help me,thanks in advance…

Hey @yash.sakali,

Please create a new topic with steps to reproduce your issue and your request body JSON.

Thanks,
Tommy