/**
  * Initializes HipChat API if credentials are valid.
  * 
  * @access public
  * @return bool
  */
 public function initialize_api()
 {
     if (!is_null($this->api)) {
         return true;
     }
     /* Load the API library. */
     if (!class_exists('HipChat')) {
         require_once 'includes/class-hipchat.php';
     }
     /* Get the OAuth token. */
     $oauth_token = $this->get_plugin_setting('oauth_token');
     /* If the OAuth token, do not run a validation check. */
     if (rgblank($oauth_token)) {
         return null;
     }
     $this->log_debug(__METHOD__ . '(): Validating API Info.');
     /* Setup a new HipChat object with the API credentials. */
     /**
      * Enable or disable Verification of Hipchat SSL
      *
      * @param bool True or False to verify SSL
      */
     $verify_ssl = apply_filters('gform_hipchat_verify_ssl', true);
     $hipchat = new HipChat($oauth_token, $verify_ssl);
     /* Run an authentication test. */
     if ($hipchat->auth_test()) {
         $this->api = $hipchat;
         $this->log_debug(__METHOD__ . '(): API credentials are valid.');
         return true;
     } else {
         $this->log_error(__METHOD__ . '(): API credentials are invalid.');
         return false;
     }
 }