/** * Validates current session at Registry side * * @return json */ public function validate($cltrid = false) { $json = ApiRequest::GET('/auth', $cltrid ?: ApiRequest::defaultClientTransactionID(), $this->getAuthToken()); $response = CommonFunctions::fromJSON($json); if ($response->code == 1000) { $this->_sessionData['expires'] = $response->result['expires']; } return $json; }
/** * Check if host already exist at ST Registry * * @param str $hostname * * @return boolean */ public function exist($hostname, $cltrid = false) { $json = ApiRequest::GET(sprintf("/hosts/%s/check", $hostname), $cltrid ?: ApiRequest::defaultClientTransactionID(), STRegistry::Session()->getAuthToken()); $response = CommonFunctions::fromJSON($json); return (bool) (!$response->result['avail']); }
/** * Perform domain whois query * * @param str $domainName * * @return str json whois response */ public function whois($domainName, $cltrid = false) { return ApiRequest::GET(sprintf("/whois/%s", $domainName), $cltrid ?: ApiRequest::defaultClientTransactionID(), STRegistry::Session()->getAuthToken()); }