PHRETS icon indicating copy to clipboard operation
PHRETS copied to clipboard

Problem with fetching property data

Open bushrashahid opened this issue 6 years ago • 2 comments

Hi, I am using this API and getting error while fetching property data.. Please have a look below error.

Fatal error: Uncaught PHRETS\Exceptions\RETSException: Unauthorized Query in /home/projec47/public_html/buywithbrady.com/real-state/vendor/troydavisson/phrets/src/Session.php:424 Stack trace: #0 /home/projec47/public_html/buywithbrady.com/real-state/vendor/troydavisson/phrets/src/Session.php(280): PHRETS\Session->request('Search', Array) #1 /home/projec47/public_html/buywithbrady.com/real-state/index.php(89): PHRETS\Session->Search('Property', '', '*', Array) #2 {main} thrown in /home/projec47/public_html/buywithbrady.com/real-state/vendor/troydavisson/phrets/src/Session.php on line 424 This is my code for fetching property data.

$results = $rets->Search('Property', 'Property', '*', ['Limit' => 3]); echo "<pre>"; var_dump($results); Please let me know where is my mistake.

bushrashahid avatar Jan 12 '19 06:01 bushrashahid

The following is not right: $results = $rets->Search('Property', 'Property', '*', ['Limit' => 3]);

The second parameter is for Property Class Type. In case it's RE_1, LD_2, CI_3, or MF_4. It may vary by market.

It should look something like:

$results = $rets->Search('Property', 'RE_1', '*', ['Limit' => 3]);

maietta avatar Jan 20 '19 18:01 maietta

Hi,

I'm getting an error : ( ! ) Fatal error: Uncaught PHRETS\Exceptions\RETSException: Invalid Query Syntax in D:\wamp64\www\php\phretsn\vendor\troydavisson\phrets\src\Session.php on line 427

1 | 0.0007 | 371784 | {main}( ) | ...\index.php:0 2 | 1.2339 | 2424280 | PHRETS\Session->Search( ) | ...\index.php:35 3 | 1.2343 | 2427792 | PHRETS\Session->request( ) | ...\Session.php:280

Here is my Code : /* Configuration */ $config = new \PHRETS\Configuration; $config->setLoginUrl( $rets_login_url ); $config->setUsername( $rets_username ); $config->setPassword( $rets_password );

$rets = new \PHRETS\Session( $config );

/* Login */ $connect = $rets->Login();

/* Get Feeds / $results = $rets->Search('Property', 'RE_1', '', ['Limit' => 3, 'Select' => 'LIST_1,LIST_105,LIST_15,LIST_22,LIST_87,LIST_133,LIST_134']); foreach ($results as $r) { var_dump($r); }

Thank you.

pareshsojitra avatar May 25 '20 20:05 pareshsojitra