Working with Zoom API with PHP

Hello!

I need to Zoom meetings to my website. So I need to generate meeting and links to join it. I have some questions about it. Is it possible to do this on free account? What API i must use? (I prefer users join meeting without login if its possible).

In my development I am tried to make different requests, but I am always getting in response:
“Invalid access token.”

I tried different ways, and with herokuapp.com, i have a lot of progress, but “continue” button not working for me, when I logged in.

I prefer the simplest solution, te create meeting and make join link, please help me with that, maybe some examples on PHP.

herokuapp CODE:
$url = ‘https://xxxxxx.herokuapp.com’;
$data = array(‘meetingNumber’ => ‘7945472637’, ‘role’ => ‘0’);

// use key 'http' even if you send the request to https://...
$options = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
        'method'  => 'POST',
        'content' => http_build_query($data)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }

//var_dump($result);
$resAr = json_decode($result, true);
$signature = $resAr['signature'];
echo '
<div class="iframe-container" style="overflow: hidden; padding-top: 56.25%; position: relative;">
	<iframe allow="microphone; camera" style="border: 0; height: 100%; left: 0; position: absolute; top: 0; width: 100%;" src="https://success.zoom.us/wc/join/7945472637" frameborder="0"></iframe>
</div>
';

Or I try to make simple post request and I am getting wrong auth token:
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.zoom.us/v2/users/maksim@unionfintech.com/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\":\"string\",\"type\":\"integer\",\"start_time\":\"string [date-time]\",\"duration\":\"integer\",\"timezone\":\"string\",\"password\":\"string\",\"agenda\":\"string\",\"recurrence\":{\"type\":\"integer\",\"repeat_interval\":\"integer\",\"weekly_days\":\"string\",\"monthly_day\":\"integer\",\"monthly_week\":\"integer\",\"monthly_week_day\":\"integer\",\"end_times\":\"integer\",\"end_date_time\":\"string [date-time]\"},\"settings\":{\"host_video\":\"boolean\",\"participant_video\":\"boolean\",\"cn_meeting\":\"boolean\",\"in_meeting\":\"boolean\",\"join_before_host\":\"boolean\",\"mute_upon_entry\":\"boolean\",\"watermark\":\"boolean\",\"use_pmi\":\"boolean\",\"approval_type\":\"integer\",\"registration_type\":\"integer\",\"audio\":\"string\",\"auto_recording\":\"string\",\"enforce_login\":\"boolean\",\"enforce_login_domains\":\"string\",\"alternative_hosts\":\"string\",\"global_dial_in_countries\":[\"string\"],\"registrants_email_notification\":\"boolean\"}}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer g9o8vEE4wX_AoePQ40lQ5aEkQU-L4BB6A",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

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

Hey @maksim,

Looks like you are just passing in your JWT API Key and not your JWT Token.

"authorization: Bearer g9o8vEE4wX_AoePQ40lQ5aEkQU-L4BB6A"

Follow the guides here to embed the created meeting into your site:

Thanks,
Tommy