Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rets::InvalidRequest: Got error code 20203 (Invalid Class Type) #92

Closed
yuuki-hunter opened this issue Jan 16, 2015 · 4 comments
Closed

Comments

@yuuki-hunter
Copy link

Hi,

I'm trying to connect to NTREIS (RETS/1.5) with the rets gem. Logging in works fine, but when I try to retrieve a property I get the Rets::InvalidRequest error.

property = client.find :first, {search_type: 'Property', class: 'RES', query: '(178=ACT)'}

According to the 1.5 spec the Well-Known Class Name for residential properties is RES. But I've tried other class names such as 'Residential-Property', 'ResidentialProperty', '1', etc. all to no avail.

This is my first time working with RETS, so it's probably something obvious that I'm missing.

Also I see the the Client Class supports logging. How do I turn that on ? I tried:

client = Rets::Client.new({ login_url: '[url]', username: '[username]', password: '[password]', version: 'RETS/1.5', logger: true })

but got the following error, when I ran client.login

NoMethodError: undefined method debug?' for true:TrueClass

Help appreciated!

Thanks,
YH

@jDeppen
Copy link
Contributor

jDeppen commented Jan 16, 2015

Check out RETS MD, it will give you what you need. I found out I was missing a few things myself.

This might be good to put in the README actually.

@dougcole
Copy link
Contributor

Yep, what @jDeppen said. As for the logger, the initializer expects an actual instance of the logger, something more like Logger.new(STDOUT).

@yuuki-hunter
Copy link
Author

Thanks for that!

Using RETS MD I discovered that NTREIS only accepts one Class Type for the Property resource ("Listing"). It expects the type of property to be specified in the query string (e.g. PropertyType=RES).

Many thanks.

@yuuki-hunter
Copy link
Author

Thanks Doug.

client = Rets::Client.new({ login_url: '[url]', username: '[username]', password: '[password]', version: 'RETS/1.5', logger: Logger.new(STDOUT) })

Worked like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants