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
449 stars 235 forks source link

Client error: `401 Access Denied` #291

Open rekharajasekhar94 opened 3 years ago

rekharajasekhar94 commented 3 years ago

Hi Team, We are new to RETS server connection. We are trying to connect RETS to our Laravel (V7.30) project. We installed troydavisson/PHRETS module into our project to check the API connectivity. When we tried to connect to get basic data, we are getting error

GuzzleHttp\Exception\ClientException Client error: 401 Access Denied response: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xml (truncated...)

The code is as below:

$config = new \PHRETS\Configuration; $config->setLoginUrl('xxxxxxxxxxx') ->setUsername('XXXXXXXX') ->setPassword('XXXXXXXX') ->setRetsVersion('1.7.2'); \PHRETS\Http\Client::set(new \GuzzleHttp\Client); $connect = $rets->Login(); $options = array("UsePost" => 1); $results = $rets->Search("PROPERTY", "RES", "(LISTSTATUS=|ACT)", $options); print_r($results);

Kindly help us if is there anything we missed. Also, let us know if the above process is correct or not.

maietta commented 2 years ago

We're now having what appears to be the same issue..

dayoneweb commented 1 year ago

I wasn't having this issue, but now I am for some reason.

maietta commented 1 year ago

I've come across this problem after hitting a rate limit but also ran into this when the feed provider decided to switch the URLs without me being notified in advance.

My money is on rate limit is reached or maintenance.

dayoneweb commented 1 year ago

I appreciate these tips, @maietta! I'll do some more checking into this.