troydavisson / PHRETS

PHP client library for interacting with a RETS server to pull real estate listings, photos and other data made available from an MLS system
http://troda.com
MIT License
451 stars 236 forks source link

[status code] 404 [reason phrase] Not Found #131

Closed ahsan154 closed 7 years ago

ahsan154 commented 7 years ago

Hi troy!

sorry for being so dumb. actually its my first time with this thing.

I am getting the following error:

( ! ) Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error response [url] http://rets.mfrmls.com/contact/rets/search?SearchType=Property&Class=Listing&Query=%2A&QueryType=DMQL2&Count=1&Format=COMPACT-DECODED&Limit=9999&StandardNames=0 [status code] 404 [reason phrase] Not Found' in D:\wamp\www\mls_fl\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 89

( ! ) GuzzleHttp\Exception\ClientException: Client error response [url] http://rets.mfrmls.com/contact/rets/search?SearchType=Property&Class=Listing&Query=%2A&QueryType=DMQL2&Count=1&Format=COMPACT-DECODED&Limit=9999&StandardNames=0 [status code] 404 [reason phrase] Not Found in D:\wamp\www\mls_fl\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 89

My code is:

$rets->Login();

$results = $rets->Search('Property', 'Listing', '*', [ 'QueryType' => 'DMQL2', 'Count' => 1, // count and records 'Format' => 'COMPACT-DECODED', 'Limit' => 9999, 'StandardNames' => 0, // give system names ] );

foreach ($results as $r) { var_dump($r); }

Regards, Ahsan

troydavisson commented 7 years ago

When you use your RETS credentials to log into www.retsmd.com, do you see Property as one of the Resources listed, with Listing as something listed under that?

ahsan154 commented 7 years ago

yes dear, it is

screenshot_1

troydavisson commented 7 years ago

My next guess is the query. Change * to (Matrix_Unique_ID=0+) and see if that changes things. I've never seen a server return a 404 in that case but who knows.

ahsan154 commented 7 years ago

Still no luck :(

jcorapi commented 7 years ago

I'm running into the same issue. Has anyone else been able to resolve this??

troydavisson commented 7 years ago

Are you still seeing this? I'm not-so-secretly hoping it was a temporary server issue because that's really bizarre.

Have you tried the same code/credentials on a non-Windows environment?

jcorapi commented 7 years ago

So it turned out.....I needed to select the fields I wanted. I believe this is just the way Matrix was set-up. I used it for the RI-MLS...Florida seems to have the same system set-up as RI.

jcorapi commented 7 years ago

There is a limit of how many fields can be returned....the number I believe is 291. I don't believe this has to do with your code Troy. I think this is just how the server is set-up. Am I only one that wonder WTH was the real estate industry thinking when they set-up their databases?? lol.