Hubspot_Helpers::api_token_info()

api_token_info


Return Return

(void)


Source Source

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

	public function api_token_info() {

		$token_info = get_transient( '_automator_hubspot_token_info' );

		if ( ! $token_info ) {

			$params = array(
				'action' => 'access_token_info',
			);

			try {

				$response = $this->api_request( $params );

				$token_info = $response['data'];

				set_transient( '_automator_hubspot_token_info', $token_info, DAY_IN_SECONDS );

			} catch ( \Exception $e ) {
				$token_info = false;
			}
		}

		return $token_info;
	}