• Home
  • Knowledgebase
  • DevDocs
  • Translations
  • Support
  • Live Preview

logo DevDocs

By The Events Calendar
Filter by type:
Skip to content
Filter by type:
Search
Browse: Home / Classes / Account_API / Account_API::save_access_and_expiration()
Product: Virtual Events

Account_API::save_access_and_expiration( $id,  $response )

{@inheritDoc}


Source

File: src/Tribe/Meetings/Zoom/Account_API.php

	public function save_access_and_expiration( $id, array $response ) {
		if ( ! (
			isset( $response['body'] )
			&& ( false !== $d = json_decode( $response['body'], true ) )
			&& isset( $d['access_token'], $d['refresh_token'], $d['expires_in'] )
		)
		) {
			do_action( 'tribe_log', 'error', __CLASS__, [
				'action'  => __METHOD__,
				'code'    => wp_remote_retrieve_response_code( $response ),
				'message' => 'Response body missing or malformed',
			] );

			return false;
		}

		$access_token  = $d['access_token'];
		$refresh_token = $d['refresh_token'];
		$expiration    = $this->get_exiration_time_stamp( $d['expires_in'] );

		$this->set_account_access_by_id( $id, $access_token, $refresh_token, $expiration );

		return true;
	}

Expand full source code Collapse full source code

The Events Calendar
  • Home
  • Products
  • Blog
  • Support
© 2026 The Events Calendar Terms and Conditions Privacy