1

我向 ZOOM 的 EU api 发送 cURL 请求以创建会议。我的请求根本没有从 API 中得到任何响应,甚至是错误或拒绝。我错过了什么?

我在 Zoom 的市场上创建了一个 JWT 应用程序,我从中获得了一个 API 密钥和一个 API 密钥。我正在使用来自ZoomAPIWrapper的函数来生成身份验证令牌:

private function generate_JWT()
{
    $token = [
        'iss' => $this->api_key,
        'exp' => time() + 60,
    ];
    $header = [
        'typ' => 'JWT',
        'alg' => 'HS256',
    ];

    $to_sign = self::url_safe_B64_encode(json_encode($header)) . '.' . self::url_safe_B64_encode(json_encode($token));
    $signature = hash_hmac('SHA256', $to_sign, $this->api_secret, true);
    return $to_sign . '.' . self::url_safe_B64_encode($signature);
}

网址是https://eu01api-www4local.zoom.us/users/me/meetings

标题是:

Array
(
    [0] => Authorization: Bearer XXXXXAUTH_KEY_HEREXXXXX
    [1] => Content-Type: application/json
    [2] => Accept: application/json
)

我的请求正文是 JSON:

{
  "topic": "My workshop",
  "type": 2,
  "start_time": "2021-01-06T09:15:00Z",
  "duration": 375,
  "schedule for": "person@example.com",
  "timezone": "GMT",
  "agenda": "My workshop agenda",
  "settings": {
      "host_video": false,
      "participant_video": false,
      "mute_upon_entry": true,
      "approval_type": 0,
      "alternative_hosts": "",
      "close_registration": true,
      "waiting_room": true,
      "registrants_email_notification": true,
      "contact_name": "Official name",
      "contact_email": "official.email@example.com",
      "show_share_button": false,
      "allow_multiple_devices": true,
      "encryption_type": "enhanced_encryption"
  }
}

我提交以上所有内容:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');

$result = curl_exec($ch);
4

1 回答 1

0

Zoom 文档指出:

To support GDPR requirements of EU customers, you may use 
https://eu01api-www4local.zoom.us 
as the base URL for all API requests associated with EU accounts.

除了您还必须添加/v2/到该网址的末尾才能使其正常工作。

我觉得不早点解决它很傻,但我也觉得如果你发布一个特定的 URL 以供特定用户使用,你应该发布整个事情......

于 2020-12-19T22:13:40.420 回答