First time here? Check out the FAQ!
0

Am not getting any results from PHPRETS

I am using PHPRETS to connect, and have a few different search criteria:

$results = $rets->Search("property", "RES", "", array('Limit' => 5));
$results = $rets->Search(
    $pc,
    $class,
    $query,
    [
        'QueryType' => 'DMQL2',
        'Count' => 1, // count and records
        'Format' => 'COMPACT-DECODED',
        'Limit' => 99999999,
        'StandardNames' => 0, // give system names
    ]

But I'm not getting any results. What should the search criteria be to see if there are any results available at all?

broizen2's avatar
broizen2
asked 2016-08-16 20:05:27 -0500
bwolven's avatar
bwolven
updated 2016-08-18 17:24:45 -0500
edit flag offensive 0 remove flag close merge delete

Comments

What MLS URL and account name? Was the login successful?

bwolven's avatar bwolven (2016-08-16 21:36:32 -0500) edit

MLS URL: http://saam.rets.fnismls.com/rets/fni... username: rnettleton

broizen2's avatar broizen2 (2016-08-16 21:48:31 -0500) edit
add a comment see more comments

1 Answer

0

Please use this Login URL: "http://saam-rets.paragonrels.com/rets/fnisrets.aspx/SAAM/login?rets-version=rets/1.7.2"

I don't see where you are sending the Query parameter. The Query parameter is only optional for RETS/1.8 and up and you are using 1.7.2.

If you don't want to use a specific query you can use a generic one like this depending on the resource:

Property/Media/Tour/OpenHouse: (L_ListingID=0+)

Agent/ActiveAgent: (U_AgentID=0+)

Office/ActiveOffice: (O_OfficeID=0+)

Also in our logs I see some requests returning invalid class error.

The valid property classes for SAAM are: RE_1, LD_2, CI_3, RI_4

Update 8/18/2016 09:20 CST

There are some examples of how to use PHRETS and how to do searches on github.com:

"https://github.com/troydavisson/PHRETS"

"https://github.com/troydavisson/PHRETS/wiki/SearchQuery"

I see a few things wrong with your code:

  • You didn't provide a query for your search unless you specify RETS/1.8 the query parameter is required. If you add something like (L_ListingID=0+) it should work.

  • The Select parameter tells what data fields to return. If you leave it off, it returns all available fields. You have it set to: "LIST_1" which isn't a valid field name.

Something like this should work provided you did the other steps to establish a connection:

$results = $rets->Search("property", "RE_1", "(L_ListingID=0+)", array('Limit' => 5, 'Select' => 'L_ListingID')); // print_r($results); foreach ($results as $r) { var_dump($r); }

I would also suggest doing a logout, which I think is $rets->Disconnect(), when you are finished which the PHRETS examples don't show which will make sure the session gets closed.

bwolven's avatar
bwolven
answered 2016-08-17 08:46:08 -0500, updated 2016-08-18 13:57:56 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks for the quick response! Here is what I am trying:

$results = $rets->Search("property", "RE_1", "", array('Limit' => 5, 'Select' => 'LIST_1'));
// print_r($results);
foreach ($results as $r) {
    var_dump($r);
}

I'm not getting any results

broizen2's avatar broizen2 (2016-08-17 19:30:33 -0500) edit

Were you able to resolve the issue you were having?

vendorsupport's avatar vendorsupport (2016-09-16 10:38:02 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer