Unauthorized Query in PhRETS
date_default_timezone_set('America/New_York');
require_once("vendor/autoload.php");
$config = new \PHRETS\Configuration; $config->setLoginUrl("http://rebrae.retsiq.com/contact/rets/login";) ->setUsername("eroomvie") ->setPassword("*") ->setUserAgent("RoomView/1.0") ->setUserAgentpassword("****") ->setRetsVersion('1.7.2');
$rets = new \PHRETS\Session($config);
$connect = $rets->Login();
$system = $rets->GetSystemMetadata(); var_dump($system);
$results = $rets->Search('Property', 'RESIDENTIAL', '(L_Status=1_0)', ['Limit' => 20, "offset" => 1]); foreach ($results as $r) { var_dump($r); }
?>
———————————— Code End —————————————
the output of this code with error is as follows —
————————— Ouput Start —————————————— /Users/vivek/Sites/temp/rets/test.php:36: class PHRETS\Models\Metadata\System#29 (4) { protected $elements => array(5) { [0] => string(8) "SystemID" [1] => string(17) "SystemDescription" [2] => string(14) "TimeZoneOffset" [3] => string(8) "Comments" [4] => string(7) "Version" } protected $session => class PHRETS\Session#2 (8) { protected $configuration => class PHRETS\Configuration#3 (9) { protected $username => string(8) "eroomvie" protected $password => string(8) "*" protected $login_url => string(43) "http://rebrae.retsiq.com/contact/rets/login"; protected $user_agent => string(12) "RoomView/1.0" protected $user_agent_password => string(17) "*****" protected $rets_version => class PHRETS\Versions\RETSVersion#4 (2) { ... } protected $http_authentication => string(6) "digest" protected $strategy => class PHRETS\Strategies\StandardStrategy#34 (2) { ... } protected $options => array(0) { ... } } protected $capabilities => class PHRETS\Capabilities#19 (1) { protected $capabilities => array(6) { ... } } protected $client => class GuzzleHttp\Client#5 (1) { private $config => array(7) { ... } } protected $logger => NULL protected $rets_session_id => string(38) "-f5b85d52-54b8-4e7e-b154-f84ddcb1045c-" protected $cookie_jar => class GuzzleHttp\Cookie\CookieJar#18 (2) { private $cookies => array(0) { ... } private $strictMode => bool(false) } protected $last_request_url => string(98) "http://rebrae.retsiq.com:80/contact/rets/getmetadata?Type=METADATA-SYSTEM&ID=0&Format=STANDARD-XML"; protected $last_response => class PHRETS\Http\Response#57 (1) { protected $response => class GuzzleHttp\Psr7\Response#54 (6) { ... } } } protected $attributes => array(0) { } protected $values => array(5) { 'SystemID' => string(3) "RAE" 'SystemDescription' => string(34) "REALTORS® Association of Edmonton" 'TimeZoneOffset' => string(1) "Z" 'Comments' => string(0) "" 'Version' => string(10) "19.6.37528" } } PHP Fatal error: Uncaught PHRETS\Exceptions\RETSException: Unauthorized Query in /Users/vivek/Sites/temp/rets/vendor/troydavisson/phrets/src/Session.php:426 Stack trace:
0 /Users/vivek/Sites/temp/rets/vendor/troydavisson/phrets/src/Session.php(280): PHRETS\Session->request('Search', Array)
1 /Users/vivek/Sites/temp/rets/test.php(51): PHRETS\Session->Search('Property', 'RESIDENTIAL', '(L_Status=1_0)', Array)
2 {main}
thrown in /Users/vivek/Sites/temp/rets/vendor/troydavisson/phrets/src/Session.php on line 426
Fatal error: Uncaught PHRETS\Exceptions\RETSException: Unauthorized Query in /Users/vivek/Sites/temp/rets/vendor/troydavisson/phrets/src/Session.php on line 426
PHRETS\Exceptions\RETSException: Unauthorized Query in /Users/vivek/Sites/temp/rets/vendor/troydavisson/phrets/src/Session.php on line 426
Call Stack: 0.0008 359448 1. {main}() /Users/vivek/Sites/temp/rets/test.php:0 0.7909 2204640 2. PHRETS\Session->Search() /Users/vivek/Sites/temp/rets/test.php:51 0.7917 2207992 3. PHRETS\Session->request() /Users/vivek/Sites/temp/rets/vendor/troydavisson/phrets/src/Session.php:280 ————————— Output End ———————————————
Comments