4

I'm using rets gem in ruby on rails api for getting data from mls.I'm try to getting Data using MlsNum In query. Here is my code:

result = clientobj.find :all, {
    search_type: "property",
    class: "CommercialProperty",
    query: "(MLNUM=|W4214585)"
}

But it gives me this error:

MLS feed: Got error code 20200 (Unknown Query Field)

Please help me I'm stuck for a day it's important for me.

  • See [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – anothermh Oct 19 '18 at 05:20
  • Please provide full request call in your question. Example: `property = client.find :first, { search_type: 'Property', class: 'CLASS_NAME', query: 'RETS_QUERY', limit: 1 }` – Alex Baidan Oct 19 '18 at 06:37
  • Hii Oleksii ,I want access the data from mls number. I'm giving MLNUM in query but it gives me error code 20200 . – Priyadarshani mini Oct 19 '18 at 06:59
  • I can only give you few recommendations. – Alex Baidan Oct 19 '18 at 07:12
  • 1. This gem is quite outdated. Even link to rest.org in it description redirected to new website reso.org, which have more fresh ruby repo in [documentation](https://www.reso.org/web-api-tools/). 2. If you still need this old resource, try to dig in to understand where the problem is. First of all who gives this error - external API (you can tru with curl) or ruby code? If external API: is `client` object you use connected to API? Also try to find their docs and check how to build query. – Alex Baidan Oct 19 '18 at 07:26
  • Can anyone help me how to get all mls data from query without giving any property type in query.Right Now I am giving like this : result = clientObj.find :all, { search_type: "Property", class: "", query: "Status|=A" } – Priyadarshani mini Oct 31 '18 at 10:36
  • @Priyadarshanimini, I'm not aware of any MLS that will allow you to query without the class so you get can multiple property types in one go. Some MLS's will provide a "Multi" class that combines data for multiple property types for this purpose, but if the one you are connecting to doesn't have this, you're probably out of luck. – Chris Curtis Nov 02 '18 at 19:09

2 Answers2

2

Try like this

result = clientobj.find :all, {
    search_type: "Property",
    class: "CommercialProperty",
    query: "(MLNUM=W4214585)"
}

also help this link https://retsmd.com/ login with your api details.

0

Can you try your query like this,

query: "(MLNUM=W4214585)"

Just ensure the field name is spelled correctly ('MLNUM' itself or something else)

I just removed the pipe symbol ("|") from the query.

V-T
  • 756
  • 2
  • 9
  • 22