You are here

function zoomapi_meeting_create in Zoom API 7

Create Meeting.

@todo add meeting tracking for easier start/join url lookups for live meetings.

Parameters

object $account: The Drupal account to act as the host.

array $options: Optional array of meeting options.

Return value

array An array of the meeting setup.

File

./zoomapi.module, line 442
Main file for the Zoom API module.

Code

function zoomapi_meeting_create($account, array $options = []) {
  if (empty($account->data['zoomapi_user_id'])) {
    return [];
  }
  if (empty($options['type'])) {
    $options['type'] = variable_get('zoomapi_meeting_type_default', ZOOMAPI_MEETING_TYPE_DEFAULT);
  }
  if (empty($options['topic'])) {
    $options['topic'] = zoomapi_meeting_topic_generate($account, $options);
  }
  $zoomapi_meeting = new ZoomAPIMeeting();
  $zoom_meeting = $zoomapi_meeting
    ->create($account->data['zoomapi_user_id'], $options['topic'], $options['type'], $options);
  zoomapi_track_meeting($zoom_meeting);
  return $zoom_meeting;
}