Zoom_Helpers::add_to_meeting( mixed $user, mixed $meeting_key, mixed $action_data )

add_to_meeting


Parameters Parameters

$user

(Required)

$meeting_key

(Required)

$action_data

(Required)


Top ↑

Return Return

(void)


Source Source

File: src/integrations/zoom/helpers/zoom-helpers.php

	public function add_to_meeting( $user, $meeting_key, $action_data ) {
		if ( empty( $user['email'] ) || false === is_email( $user['email'] ) ) {
			throw new \Exception(  __( 'Email address is missing or invalid.', 'uncanny-automator' ) );
		}
		if ( empty( $user['first_name'] ) ) {
			throw new \Exception( __( 'First name is missing', 'uncanny-automator' ) );
		}
		if ( empty( $meeting_key ) ) {
			throw new \Exception( __( 'Meeting key is missing', 'uncanny-automator' ) );
		}
		$body = array(
			'action'       => 'register_meeting_user',
			'meeting_key'  => $meeting_key
		);
		$body = array_merge( $body, $user );
		$response = $this->api_request( $body, $action_data );
		if ( 201 !== $response['statusCode'] ) {
			throw new \Exception( __( 'User could not be added to the meeting', 'uncanny-automator' ) );
		}
		return $response;
	}