I'm working on a Real Estate project with Ruby on Rails based on Florida, there are no more details about matrixrets.swflamls API but I need fetch data from there database save to my own database this regular basis for data update and create.
I have following configuration for fetching data
client = Rets::Client.new({
login_url: 'http://matrixrets.swflamls.com/rets/Login.ashx',
username: 'XXXXXXXXXXXXXX',
password: 'XXXXXXXXXXXXXX'
})
Query for fetching data, this query copied from this tutorial, this tutorial is related but not exact for my API
properties = client.find (:all), {
search_type: 'Property',
class: 'RES',
querytype: 'DMQL2',
Format: 'COMPACT',
query: "(YearBuilt=1900+), (Status=A)",
}
<% properties.each do |data| %>
<%= data['Bedrooms'] %>
<% end %>
I have some keys for properties like active, pending etc... the below
'A', 'AC', 'AP', 'AS', 'I', 'P', 'PC', 'R', 'T', 'W'
I have two questions:
How to fetch data from there database
If I got data then how to all data fetch like Status equal all keys.
Currently not any error also not fetching any data
Much appriciated
Ok, I think you have missed something in you your configuration section if you got the RETSMD for looking details on your API you found the
versionI think you missed the version see the below.Then update your query using
no_records_not_an_errormethod for if not find data then not showing any error else will show a nil error, see the belowThat your problem 1
Hope that is work
Now problem 2
You can declare an array and keep all keys inside array like below
And then update your query
See the console have counted any number if yes then working and then move forward.
Hope it helps