You are here

function zoomapi_api_create_meeting in Zoom API 7.2

Create Zoom Meeting.

1 call to zoomapi_api_create_meeting()
zoomapi_create_meeting in ./zoomapi.module
Create Zoom Meeting.

File

./zoomapi.api.inc, line 201
API callbacks for Zoom API module.

Code

function zoomapi_api_create_meeting($zoom_user_id, array $params, array $context = []) {
  try {
    drupal_alter('zoomapi_create_meeting', $params, $context);
    $params['user_id'] = $zoom_user_id;
    list($entity_type, $entity_id) = zoomapi_extract_entity_info_from_meeting_context($context);
    if (!$entity_id || !$entity_type) {
      throw new Exception('Missing entity ID or type.');
    }
    $zoom_client = zoomapi_client();
    $zoom_meeting = $zoom_client
      ->api('meeting')
      ->create($params);
    zoomapi_track_meeting($zoom_meeting, $entity_type, $entity_id);
    module_invoke_all('zoomapi_meeting_create', $zoom_meeting, $context);
    return $zoom_meeting;
  } catch (\Exception $e) {
    watchdog(__FUNCTION__, 'Unable to create meeting for Zoom account @id. Error: @e', [
      '@e' => $e
        ->getMessage(),
      '@id' => $zoom_user_id,
    ], WATCHDOG_CRITICAL);
    return FALSE;
  }
}