0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

サーバー側からZoom会議を作成する-4:会議の作成

Posted at

概要

  • 前回の記事 の続きです
  • アクセストークンを使って、会議を作成します
  • アクセストークンの有効期限が切れていた場合は、リフレッシュトークンを使って新しいアクセストークンを取得します

アクセストークンの期限の確認と更新

  • アクセストークンの期限が切れていた場合は、リフレッシュトークンを使って、新しいアクセストークンを取得します
    • 保存しておきます
  • 更新の例
curl -X POST https://zoom.us/oauth/token \
  -H "Authorization: Basic BASE64_ENCODED_CLIENT_ID_AND_SECRET" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN"
  • 戻り値の例
    • リフレッシュトークンも更新されるので、併せて保存しておきます
{
  "access_token": "NEW_ACCESS_TOKEN",
  "token_type": "bearer",
  "refresh_token": "NEW_REFRESH_TOKEN",
  "expires_in": 3600,
  "scope": "meeting:write user:read"
}

会議の作成

cURLのサンプル

curl -X POST https://api.zoom.us/v2/users/me/meetings \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "topic": "Sample Meeting",
        "type": 2,
        "start_time": "2024-09-15T10:00:00",
        "duration": 30,
        "timezone": "Asia/Tokyo",
        "agenda": "This is a sample meeting",
        "settings": {
          "host_video": true,
          "participant_video": true,
          "join_before_host": false,
          "mute_upon_entry": true,
          "approval_type": 0,
          "audio": "voip",
          "auto_recording": "none"
        }
      }'

主要なパラメタの説明

  • Authorization: Bearer YOUR_ACCESS_TOKEN ヘッダ
    • 取得したアクセストークンを使う
  • リクエストボディ
    • topic
      • 会議のタイトル
    • type
      • 通常のスケジュールされた会議は「2」
    • start_time
      • 会議の開始時間(ISO 8601形式で指定)
    • duration
      • 会議の時間(分単位)
    • settings
      • 会議の設定
      • host_video
        • ホストのビデオを有効にするか
      • participant_video
        • 参加者のビデオを有効にするか
      • join_before_host
        • ホストよりも前に参加を許可するか
      • mute_upon_entry
        • 参加者が入室時にミュートにするか
      • approval_type
        • 参加の承認方式(0 = 自動承認、1 = 手動承認)
      • auto_recording
        • 会議の自動録画設定(例:none, cloud, local)

エントリポイント /users/me/meetings

  • ユーザーの指定をしなくても、アクセストークンに関連付けられたユーザーを指定して、会議を作成する
  • 他のユーザーのために会議を作成したい場合は、そのユーザーのIDを/users/{userId}/meetings の形で指定する

戻り値の例

  • 長いので一部省略しています
{
	"uuid": "JiiwK(略)eKA==",
	"id": 86220627999,
	"host_id": "8SCtM(略)bX32Q",
	"host_email": "myhost@example.com",
	"topic": "Sample Meeting",
	"type": 2,
	"status": "waiting",
	"start_time": "2024-09-15T10:00:00Z",
	"duration": 30,
	"timezone": "Asia/Tokyo",
	"agenda": "This is a sample meeting",
	"created_at": "2024-09-12T06:30:00Z",
	"start_url": "https://us06web.zoom.us/s/86220627999?zak=eyJ0e(略)DjxOg",
	"join_url": "https://us06web.zoom.us/j/86220627999?pwd=WzDSb(略)fgr.1",
	"registration_url": "https://us06web.zoom.us/meeting/register/tZIvd(略)op_VJ",
	"password": "216899",
	"encrypted_password": "WzDSb(略)fgr.1",
	"settings": {
		"host_video": true,
		"participant_video": true,
		"join_before_host": false,
		"mute_upon_entry": true,
		"auto_recording": "none",
		"alternative_hosts": "",
		"allow_multiple_devices": true,
		"registrants_confirmation_email": true,
		"waiting_room": false,
		"meeting_authentication": false,
		"encryption_type": "enhanced_encryption",
		"show_join_info": true,
		"private_meeting": false,
		"host_save_video_order": false,
		"sign_language_interpretation": {
			"enable": false
		},
		"email_in_attendee_report": false
	},
	"pre_schedule": false
}

録画に関するパラメタ

  • auto_recording パラメタ

    • none 自動録画は無効(デフォルト)
    • local 会議のホストのローカルに自動録画
    • cloud Zoomクラウドに自動録画(クラウド録画が有効なアカウントの場合のみ)
  • recording_authentication パラメタ

    • 録画の視聴に認証が必要かどうか
      • true 録画の視聴にZoomアカウントが必要
      • false リンクを知っていれば、誰でも録画を視聴できる

会議の開始日時の変更

  • POSTではなくPATCHを使う
  • アクセストークンが期限切れの場合は、先に更新しておく
curl -X PATCH https://api.zoom.us/v2/meetings/86220627999 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "start_time": "2024-09-21T12:00:00Z",
        "timezone": "Asia/Tokyo"
      }'

その他

  • 他にも色々できるので、APIドキュメントを参照してください。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?