-
Notifications
You must be signed in to change notification settings - Fork 2
/
zoomKey.php
37 lines (35 loc) · 1.1 KB
/
zoomKey.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
// zoom APIでユーザ一覧を取得し、ホストキーを表示する。
$curl_opt = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 60,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer ここに、zoomのJWT(JSON Web Token)を書く",
"content-type: application/json"
)
);
$curl = curl_init();
curl_setopt_array($curl, $curl_opt);
//ユーザをリスト
$url = "https://api.zoom.us/v2/users/?page_size=300";
curl_setopt($curl, CURLOPT_URL, $url);
$response = curl_exec($curl);
$err = curl_error($curl);
$res = json_decode(@$response, true);
$users = $res["users"];
foreach($users as $user){
$url = "https://api.zoom.us/v2/users/" . $user["id"];
curl_setopt($curl, CURLOPT_URL, $url);
$response = curl_exec($curl);
$err = curl_error($curl);
$res = json_decode(@$response, true);
echo $user["first_name"], " \t";
echo $user["last_name"], " \t";
echo $user["email"], " \t";
echo "key:\t", $res["host_key"];
echo "<br>";
}