【问题标题】:Zoom API request to create meetingZoom API 请求创建会议
【发布时间】:2023-03-18 22:00:01
【问题描述】:

我正在向 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);

【问题讨论】:

    标签: php php-curl zoom-sdk


    【解决方案1】:

    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 以供特定用户使用,您应该发布整个内容...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-18
      • 1970-01-01
      • 1970-01-01
      • 2020-11-04
      • 2017-12-21
      • 1970-01-01
      • 2018-06-24
      • 1970-01-01
      相关资源
      最近更新 更多