Zoom meeting Api call

I am able to create the zoom meetings through my system but didn’t get any response not even in zoom user account but it’s showing in the api log with success code 201.

Below is the api endpoint:

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

For the reference I have attached the screenshot below:
Screenshot%20from%202019-09-18%2013-33-02|690x388

Hi @dmortlock,

A 201 response for the Create Meeting API means that the meeting was successfully created. Please see the API endpoint for more details.

If you check your attached screenshot, you can see that you have indeed received a response from Zoom, I am attaching that part for your reference.

You also mentioned that you were unable to receive a response in your system, to help me troubleshoot, can you please provide me with the following info:

  • Was this a one time error or is it recurring?

  • Do you see the same error when you create a meeting using Send a Test Request option in the API documentation?

  • Are you able to see the meeting in your Zoom account? Similarly, does this meeting show up when you call the List Meetings API and/or Retrieve meetings API within your system?

  • Can you share a screenshot from your system, where it displays only the success code but not the body?

  • Can you share your code to display the response body within your system?

Thanks,
Ojus

Hi @ojus.zoom,

Thanks for your reply.

I guess it might be due to the timezone as I’m in india and I was creating meeting for the Brisbane whenever I’m creating the meeting for the current time i.e in india it’s not showing the response nor in the zoom account.
But whenever I’m creating the meetings for the next day or after some time to the current time here response is coming as well as in the zoom account.

Also I have one query related to the start time as you see I’m getting the start time in this format “2019-09-20T06:36:00Z” but in zoom account it’s showing in the correct format “05:30 PM
10:00 PM Brisbane” so can I get the start time in this format in the api response.

Thanks.
Donna

Hi @ojus.zoom,

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