class SimplyRetsClient::DefaultApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/simplyrets/api/default_api.rb, line 30
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

openhouses_get(opts = {}) click to toggle source

The SimplyRETS OpenHouses API This is the main endpoint for accessing openhouses. @param [Hash] opts the optional parameters @option opts [String] :type Request listings by a specific property type. This defaults to Residential, and you can only specify one type in a single query. @option opts [String] :listing_id Request openhouses for a specific &#x60;listingId&#x60;. @option opts [Array<String>] :cities Filter the openhouses returned by a list of valid cities. A list of valid cities can be found by making an OPTIONS request to the &#x60;/openhouses&#x60; endpoint. @option opts [Array<String>] :brokers Filter the listings returned by brokerage with a Broker ID. You can specific multiple broker parameters. Note, the Broker ID is provided by your MLS. @option opts [String] :agent Filter the listings returned by an agent ID. Note, the Agent ID is provided by your MLS. @option opts [Integer] :minprice Filter listings by a minimum price. @option opts [DateTime] :startdate Scheduled date and time of the open house showing @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset parameter by the limit to go to the next "page&quot; of listings. Also take a look at the Link HTTP Header for pre-built pagination. @option opts [Integer] :limit Set the number of listings to return in the response. This defaults to 20 listings, and can be a maximum of 50. To paginate through to the next page of listings, take a look at the &#x60;offset&#x60; parameter, or the Link in the HTTP Header. @option opts [String] :sort Sort the response by a specific field. Values starting with a minus (-) denote descending order, while the others are ascending. @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;taxAnnualAmount&#39; include the annual tax amount - &#39;taxYear&#39; include the tax year data - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available in the API response. In the future, fields which require an &#39;include&#39; may become available by default. @return [Array<OpenHouse>]

# File lib/simplyrets/api/default_api.rb, line 49
def openhouses_get(opts = {})
  data, _status_code, _headers = openhouses_get_with_http_info(opts)
  return data
end
openhouses_get_with_http_info(opts = {}) click to toggle source

The SimplyRETS OpenHouses API This is the main endpoint for accessing openhouses. @param [Hash] opts the optional parameters @option opts [String] :type Request listings by a specific property type. This defaults to Residential, and you can only specify one type in a single query. @option opts [String] :listing_id Request openhouses for a specific &#x60;listingId&#x60;. @option opts [Array<String>] :cities Filter the openhouses returned by a list of valid cities. A list of valid cities can be found by making an OPTIONS request to the &#x60;/openhouses&#x60; endpoint. @option opts [Array<String>] :brokers Filter the listings returned by brokerage with a Broker ID. You can specific multiple broker parameters. Note, the Broker ID is provided by your MLS. @option opts [String] :agent Filter the listings returned by an agent ID. Note, the Agent ID is provided by your MLS. @option opts [Integer] :minprice Filter listings by a minimum price. @option opts [DateTime] :startdate Scheduled date and time of the open house showing @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset parameter by the limit to go to the next "page&quot; of listings. Also take a look at the Link HTTP Header for pre-built pagination. @option opts [Integer] :limit Set the number of listings to return in the response. This defaults to 20 listings, and can be a maximum of 50. To paginate through to the next page of listings, take a look at the &#x60;offset&#x60; parameter, or the Link in the HTTP Header. @option opts [String] :sort Sort the response by a specific field. Values starting with a minus (-) denote descending order, while the others are ascending. @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;taxAnnualAmount&#39; include the annual tax amount - &#39;taxYear&#39; include the tax year data - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available in the API response. In the future, fields which require an &#39;include&#39; may become available by default. @return [Array<(Array<OpenHouse>, Fixnum, Hash)>] Array<OpenHouse> data, response status code and response headers

# File lib/simplyrets/api/default_api.rb, line 69
def openhouses_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.openhouses_get ..."
  end
  if opts[:'type'] && !['Residential', 'Rental', 'Multifamily', 'Condominium', 'Commercial', 'Land'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of Residential, Rental, Multifamily, Condominium, Commercial, Land'
  end
  if opts[:'sort'] && !['listprice', '-listprice', 'listdate', '-listdate', 'beds', '-beds', 'baths', '-baths'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of listprice, -listprice, listdate, -listdate, beds, -beds, baths, -baths'
  end
  # resource path
  local_var_path = "/openhouses".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if opts[:'type']
  query_params[:'listingId'] = opts[:'listing_id'] if opts[:'listing_id']
  query_params[:'cities'] = @api_client.build_collection_param(opts[:'cities'], :multi) if opts[:'cities']
  query_params[:'brokers'] = @api_client.build_collection_param(opts[:'brokers'], :multi) if opts[:'brokers']
  query_params[:'agent'] = opts[:'agent'] if opts[:'agent']
  query_params[:'minprice'] = opts[:'minprice'] if opts[:'minprice']
  query_params[:'startdate'] = opts[:'startdate'] if opts[:'startdate']
  query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'sort'] = opts[:'sort'] if opts[:'sort']
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if opts[:'include']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/vnd.simplyrets-v0.1+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<OpenHouse>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#openhouses_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
openhouses_open_house_key_get(open_house_key, opts = {}) click to toggle source

Single OpenHouse Endpoint Use this endpoint for accessing a single OpenHouse. @param open_house_key A unique OpenHouse identification key @param [Hash] opts the optional parameters @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;taxAnnualAmount&#39; include the annual tax amount - &#39;taxYear&#39; include the tax year data - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available in the API response. In the future, fields which require an &#39;include&#39; may become available by default. @return [OpenHouse]

# File lib/simplyrets/api/default_api.rb, line 132
def openhouses_open_house_key_get(open_house_key, opts = {})
  data, _status_code, _headers = openhouses_open_house_key_get_with_http_info(open_house_key, opts)
  return data
end
openhouses_open_house_key_get_with_http_info(open_house_key, opts = {}) click to toggle source

Single OpenHouse Endpoint Use this endpoint for accessing a single OpenHouse. @param open_house_key A unique OpenHouse identification key @param [Hash] opts the optional parameters @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;taxAnnualAmount&#39; include the annual tax amount - &#39;taxYear&#39; include the tax year data - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available in the API response. In the future, fields which require an &#39;include&#39; may become available by default. @return [Array<(OpenHouse, Fixnum, Hash)>] OpenHouse data, response status code and response headers

# File lib/simplyrets/api/default_api.rb, line 143
def openhouses_open_house_key_get_with_http_info(open_house_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.openhouses_open_house_key_get ..."
  end
  # verify the required parameter 'open_house_key' is set
  fail ArgumentError, "Missing the required parameter 'open_house_key' when calling DefaultApi.openhouses_open_house_key_get" if open_house_key.nil?
  # resource path
  local_var_path = "/openhouses/{openHouseKey}".sub('{format}','json').sub('{' + 'openHouseKey' + '}', open_house_key.to_s)

  # query parameters
  query_params = {}
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if opts[:'include']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/vnd.simplyrets-v0.1+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OpenHouse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#openhouses_open_house_key_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
properties_get(opts = {}) click to toggle source

The SimplyRETS Listings API This is the main endpoint for accessing your properties. View all of the available query parameters and make requests below! The API uses Basic Authentication, which most HTTP libraries will handle for you. To use the test data (which is what this pages uses), you can use the api key ‘simplyrets` and secret `simplyrets`. Note that these test listings are not live MLS listings but the data, query parameters, and response bodies will all work the same. @param [Hash] opts the optional parameters @option opts [String] :q A textual keyword search. This parameter will search the following fields, when available: - listingId (This does not search the &#x60;mlsId&#x60; field in the SimplyRETS response body) - street number - street name - mls area (major) - city - subdivision name - postal code @option opts [Array<String>] :status Request listings by a specific status. This parameter defaults to active and you can specify multiple statuses in a single query. Listing statuses depend on your MLS&#39;s availability. Below is a brief description of each status with possible synonyms which may map to your MLS-specific statuses - Active: Active Listing which is still on the market - ActiveUnderContract: An offer has been accepted but the listing is still on market. Synonyms: Accepting Backup Offers, Backup Offer, Active With Accepted. Synonyms: Offer, Backup, Contingent - Pending: An offer has been accepted and the listing is no longer on market. Synonyms: Offer Accepted, Under Contract - Hold: The listing has been withdrawn from the market, but a contract still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market - Withdrawn: The listing has been withdrawn from the market, but a contract still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market - Closed: The purchase agreement has been fulfilled or the lease agreement has been executed. Synonyms: Sold, Leased, Rented, Closed Sale - Expired: The listing contract has expired - Delete: The listing contract was never valid or other reason for the contract to be nullified. Synonyms: Kill, Zap - Incomplete: The listing has not yet be completely entered and is not yet published in the MLS. Synonyms: Draft, Partially Complted - ComingSoon @option opts [Array<String>] :type Request listings by a specific property type. This defaults to Residential and Rental. You can specify multiple property types in a single query. @option opts [String] :agent Filter the listings returned by an agent ID. Note, the Agent ID is provided by your MLS. The co-listing agent is not included in this query parameter. @option opts [Array<String>] :brokers Filter the listings returned by brokerage with a Broker ID. For some MLS areas, this is the ListOfficeId (Listing Office ID). You can specific multiple broker parameters. Note, this query parameter is only available if a Broker ID is provided by your MLS. @option opts [Integer] :minprice Filter listings by a minimum price. @option opts [Integer] :maxprice Filter listings by a maximum price @option opts [Integer] :minarea Filter listings by a minimum area size in Sq Ft. @option opts [Integer] :maxarea Filter listings by a maximum area size in Sq Ft. @option opts [Integer] :minbaths Filter listings by a minimum number of bathrooms. @option opts [Integer] :maxbaths Filter listings by a maximum number of bathrooms. @option opts [Integer] :minbeds Filter listings by a minimum number of bedrooms. @option opts [Integer] :maxbeds Filter listings by a maximum number of bedrooms. @option opts [Integer] :maxdom Filter listings by a maximum number of days on market. _Note that your MLS must provide Days on Market data._ @option opts [Integer] :minyear Filter listings by a setting a minimum year built. @option opts [Integer] :limit Set the number of listings to return in the response. This defaults to 20 listings, and can be a maximum of 50. To paginate through to the next page of listings, take a look at the &#x60;offset&#x60; parameter, or the Link in the HTTP Header. @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset parameter by the limit to go to the next "page&quot; of listings. Also take a look at the Link HTTP Header for pre-built pagination. NOTE: If you&#39;re offset is too high, you will receive an &#x60;HTTP 400 offset too high&#x60; error message. @option opts [String] :vendor Used to specify the vendor (MLS) to search from. This parameter is required on multi-MLS apps, and you can only query one vendor at a time. To get your vendor id&#39;s make an OPTIONS request to api.simplyrets.com. @option opts [Array<String>] :postal_codes Filter the listings returned by postal codes / zip code. You can specify multiple. @option opts [Array<String>] :features Filter the listings by specific interior features. You can filter by multiple. For example, to filter trial listings by multiple features you can use, Return listings that are within a set of latitude longitude coordinates. For example, &#x60;&#x60;&#x60; Wet Bar High Ceiling &#x60;&#x60;&#x60; e.g. &#x60;simplyrets.com/services?features=Wet%20Bar&features=High%20Ceiling`; The features provided by your MLS can be seen in your OPTIONS request. To view all valid features, make a request to the SimplyRETS api root &#x60;curl -XOPTIONS -u simplyrets:simplyrets api.simplyrets.com/`; @option opts [String] :water Query water/waterfront listings only. Specify &#x60;true&#x60; to filter waterfront listings. @option opts [Array<String>] :neighborhoods Filter the listings returned by specific neighborhoods and subdivisions. You can specify multiple. @option opts [Array<String>] :cities Filter the listings returned by specific cities. You can specify multiple. @option opts [Array<String>] :counties Filter the listings returned by specific counties. You can specify multiple. @option opts [Array<String>] :points Return listings that are within a set of latitude longitude coordinates. For example; &#x60;&#x60;&#x60; 29.723837,-95.69778 29.938275,-95.69778 29.938275,-95.32974 29.723837,-95.32974 &#x60;&#x60;&#x60; Note that some MLS&#39;s do not provide latitude and longitude for their listings, which is required for this parameter to work. In these cases, SimplyRETS offers a [Geocoding Addon](simplyrets.com/services#geocoding). Check out our [blog post](simplyrets.com/blog/interactive-map-search.html) on using the &#x60;points&#x60; parameter to build a map-based app in javascript. @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;taxAnnualAmount&#39; include the annual tax amount - &#39;taxYear&#39; include the tax year data - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available in the API response. @option opts [String] :sort Sort the response by a specific field. Values starting with a minus (-) denote descending order, while the others are ascending. @return [Array<Listing>]

# File lib/simplyrets/api/default_api.rb, line 217
def properties_get(opts = {})
  data, _status_code, _headers = properties_get_with_http_info(opts)
  return data
end
properties_get_with_http_info(opts = {}) click to toggle source

The SimplyRETS Listings API This is the main endpoint for accessing your properties. View all of the available query parameters and make requests below! The API uses Basic Authentication, which most HTTP libraries will handle for you. To use the test data (which is what this pages uses), you can use the api key &#x60;simplyrets&#x60; and secret &#x60;simplyrets&#x60;. Note that these test listings are not live MLS listings but the data, query parameters, and response bodies will all work the same. @param [Hash] opts the optional parameters @option opts [String] :q A textual keyword search. This parameter will search the following fields, when available: - listingId (This does not search the &#x60;mlsId&#x60; field in the SimplyRETS response body) - street number - street name - mls area (major) - city - subdivision name - postal code @option opts [Array<String>] :status Request listings by a specific status. This parameter defaults to active and you can specify multiple statuses in a single query. Listing statuses depend on your MLS&#39;s availability. Below is a brief description of each status with possible synonyms which may map to your MLS-specific statuses - Active: Active Listing which is still on the market - ActiveUnderContract: An offer has been accepted but the listing is still on market. Synonyms: Accepting Backup Offers, Backup Offer, Active With Accepted. Synonyms: Offer, Backup, Contingent - Pending: An offer has been accepted and the listing is no longer on market. Synonyms: Offer Accepted, Under Contract - Hold: The listing has been withdrawn from the market, but a contract still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market - Withdrawn: The listing has been withdrawn from the market, but a contract still exists between the seller and the listing member. Synonyms: Hold, Hold Do Not Show, Temp Off Market - Closed: The purchase agreement has been fulfilled or the lease agreement has been executed. Synonyms: Sold, Leased, Rented, Closed Sale - Expired: The listing contract has expired - Delete: The listing contract was never valid or other reason for the contract to be nullified. Synonyms: Kill, Zap - Incomplete: The listing has not yet be completely entered and is not yet published in the MLS. Synonyms: Draft, Partially Complted - ComingSoon @option opts [Array<String>] :type Request listings by a specific property type. This defaults to Residential and Rental. You can specify multiple property types in a single query. @option opts [String] :agent Filter the listings returned by an agent ID. Note, the Agent ID is provided by your MLS. The co-listing agent is not included in this query parameter. @option opts [Array<String>] :brokers Filter the listings returned by brokerage with a Broker ID. For some MLS areas, this is the ListOfficeId (Listing Office ID). You can specific multiple broker parameters. Note, this query parameter is only available if a Broker ID is provided by your MLS. @option opts [Integer] :minprice Filter listings by a minimum price. @option opts [Integer] :maxprice Filter listings by a maximum price @option opts [Integer] :minarea Filter listings by a minimum area size in Sq Ft. @option opts [Integer] :maxarea Filter listings by a maximum area size in Sq Ft. @option opts [Integer] :minbaths Filter listings by a minimum number of bathrooms. @option opts [Integer] :maxbaths Filter listings by a maximum number of bathrooms. @option opts [Integer] :minbeds Filter listings by a minimum number of bedrooms. @option opts [Integer] :maxbeds Filter listings by a maximum number of bedrooms. @option opts [Integer] :maxdom Filter listings by a maximum number of days on market. _Note that your MLS must provide Days on Market data._ @option opts [Integer] :minyear Filter listings by a setting a minimum year built. @option opts [Integer] :limit Set the number of listings to return in the response. This defaults to 20 listings, and can be a maximum of 50. To paginate through to the next page of listings, take a look at the &#x60;offset&#x60; parameter, or the Link in the HTTP Header. @option opts [Integer] :offset Used as a cursor for pagination. Increase the offset parameter by the limit to go to the next "page&quot; of listings. Also take a look at the Link HTTP Header for pre-built pagination. NOTE: If you&#39;re offset is too high, you will receive an &#x60;HTTP 400 offset too high&#x60; error message. @option opts [String] :vendor Used to specify the vendor (MLS) to search from. This parameter is required on multi-MLS apps, and you can only query one vendor at a time. To get your vendor id&#39;s make an OPTIONS request to api.simplyrets.com. @option opts [Array<String>] :postal_codes Filter the listings returned by postal codes / zip code. You can specify multiple. @option opts [Array<String>] :features Filter the listings by specific interior features. You can filter by multiple. For example, to filter trial listings by multiple features you can use, Return listings that are within a set of latitude longitude coordinates. For example, &#x60;&#x60;&#x60; Wet Bar High Ceiling &#x60;&#x60;&#x60; e.g. &#x60;simplyrets.com/services?features=Wet%20Bar&features=High%20Ceiling`; The features provided by your MLS can be seen in your OPTIONS request. To view all valid features, make a request to the SimplyRETS api root &#x60;curl -XOPTIONS -u simplyrets:simplyrets api.simplyrets.com/`; @option opts [String] :water Query water/waterfront listings only. Specify &#x60;true&#x60; to filter waterfront listings. @option opts [Array<String>] :neighborhoods Filter the listings returned by specific neighborhoods and subdivisions. You can specify multiple. @option opts [Array<String>] :cities Filter the listings returned by specific cities. You can specify multiple. @option opts [Array<String>] :counties Filter the listings returned by specific counties. You can specify multiple. @option opts [Array<String>] :points Return listings that are within a set of latitude longitude coordinates. For example; &#x60;&#x60;&#x60; 29.723837,-95.69778 29.938275,-95.69778 29.938275,-95.32974 29.723837,-95.32974 &#x60;&#x60;&#x60; Note that some MLS&#39;s do not provide latitude and longitude for their listings, which is required for this parameter to work. In these cases, SimplyRETS offers a [Geocoding Addon](simplyrets.com/services#geocoding). Check out our [blog post](simplyrets.com/blog/interactive-map-search.html) on using the &#x60;points&#x60; parameter to build a map-based app in javascript. @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;taxAnnualAmount&#39; include the annual tax amount - &#39;taxYear&#39; include the tax year data - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available in the API response. @option opts [String] :sort Sort the response by a specific field. Values starting with a minus (-) denote descending order, while the others are ascending. @return [Array<(Array<Listing>, Fixnum, Hash)>] Array<Listing> data, response status code and response headers

# File lib/simplyrets/api/default_api.rb, line 253
def properties_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.properties_get ..."
  end
  if opts[:'sort'] && !['listprice', '-listprice', 'listdate', '-listdate', 'beds', '-beds', 'baths', '-baths'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of listprice, -listprice, listdate, -listdate, beds, -beds, baths, -baths'
  end
  # resource path
  local_var_path = "/properties".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'q'] = opts[:'q'] if opts[:'q']
  query_params[:'status'] = @api_client.build_collection_param(opts[:'status'], :multi) if opts[:'status']
  query_params[:'type'] = @api_client.build_collection_param(opts[:'type'], :multi) if opts[:'type']
  query_params[:'agent'] = opts[:'agent'] if opts[:'agent']
  query_params[:'brokers'] = @api_client.build_collection_param(opts[:'brokers'], :multi) if opts[:'brokers']
  query_params[:'minprice'] = opts[:'minprice'] if opts[:'minprice']
  query_params[:'maxprice'] = opts[:'maxprice'] if opts[:'maxprice']
  query_params[:'minarea'] = opts[:'minarea'] if opts[:'minarea']
  query_params[:'maxarea'] = opts[:'maxarea'] if opts[:'maxarea']
  query_params[:'minbaths'] = opts[:'minbaths'] if opts[:'minbaths']
  query_params[:'maxbaths'] = opts[:'maxbaths'] if opts[:'maxbaths']
  query_params[:'minbeds'] = opts[:'minbeds'] if opts[:'minbeds']
  query_params[:'maxbeds'] = opts[:'maxbeds'] if opts[:'maxbeds']
  query_params[:'maxdom'] = opts[:'maxdom'] if opts[:'maxdom']
  query_params[:'minyear'] = opts[:'minyear'] if opts[:'minyear']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
  query_params[:'vendor'] = opts[:'vendor'] if opts[:'vendor']
  query_params[:'postalCodes'] = @api_client.build_collection_param(opts[:'postal_codes'], :multi) if opts[:'postal_codes']
  query_params[:'features'] = @api_client.build_collection_param(opts[:'features'], :multi) if opts[:'features']
  query_params[:'water'] = opts[:'water'] if opts[:'water']
  query_params[:'neighborhoods'] = @api_client.build_collection_param(opts[:'neighborhoods'], :multi) if opts[:'neighborhoods']
  query_params[:'cities'] = @api_client.build_collection_param(opts[:'cities'], :multi) if opts[:'cities']
  query_params[:'counties'] = @api_client.build_collection_param(opts[:'counties'], :multi) if opts[:'counties']
  query_params[:'points'] = @api_client.build_collection_param(opts[:'points'], :multi) if opts[:'points']
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if opts[:'include']
  query_params[:'sort'] = opts[:'sort'] if opts[:'sort']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/vnd.simplyrets-v0.1+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Listing>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#properties_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
properties_mls_id_get(mls_id, opts = {}) click to toggle source

Single Listing Endpoint Use this endpoint for accessing a single listing. When you make a search to the ‘/properties` endpoint, each listing in the response will contain a unique `mlsId` field which should be used to request that listing on this route. The `mlsId` field is a unique identifier for a listing which is specific to the SimplyRETS API only. It is different from the `listingId` field is the public number given to a listing by the MLS and is not used here. @param mls_id The &#x60;mlsId&#x60; field is a unique identifier which is specific to the SimplyRETS API only. This field is different from the &#x60;listingId&#x60; field (which is the public number given to a listing by the MLS and is not used here). @param [Hash] opts the optional parameters @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available with valid data in the API response. If your MLS does not offer these fields, they will contain &#39;null&#39;. @return [Listing]

# File lib/simplyrets/api/default_api.rb, line 329
def properties_mls_id_get(mls_id, opts = {})
  data, _status_code, _headers = properties_mls_id_get_with_http_info(mls_id, opts)
  return data
end
properties_mls_id_get_with_http_info(mls_id, opts = {}) click to toggle source

Single Listing Endpoint Use this endpoint for accessing a single listing. When you make a search to the &#x60;/properties&#x60; endpoint, each listing in the response will contain a unique &#x60;mlsId&#x60; field which should be used to request that listing on this route. The &#x60;mlsId&#x60; field is a unique identifier for a listing which is specific to the SimplyRETS API only. It is different from the &#x60;listingId&#x60; field is the public number given to a listing by the MLS and is not used here. @param mls_id The &#x60;mlsId&#x60; field is a unique identifier which is specific to the SimplyRETS API only. This field is different from the &#x60;listingId&#x60; field (which is the public number given to a listing by the MLS and is not used here). @param [Hash] opts the optional parameters @option opts [Array<String>] :include Include a extra fields which are not in the default response body - &#39;association&#39; includes additional HOA data - &#39;agreement&#39; information on the listing agreement - &#39;garageSpaces&#39; additional garage data - &#39;maintenanceExpense&#39; data on maintenance expenses - &#39;parking&#39; additional parking data - &#39;pool&#39; includes an additional pool description - &#39;rooms&#39; include parameter will include any additional rooms as a list. Note that your MLS must provide these fields in their RETS data for them to be available with valid data in the API response. If your MLS does not offer these fields, they will contain &#39;null&#39;. @return [Array<(Listing, Fixnum, Hash)>] Listing data, response status code and response headers

# File lib/simplyrets/api/default_api.rb, line 340
def properties_mls_id_get_with_http_info(mls_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DefaultApi.properties_mls_id_get ..."
  end
  # verify the required parameter 'mls_id' is set
  fail ArgumentError, "Missing the required parameter 'mls_id' when calling DefaultApi.properties_mls_id_get" if mls_id.nil?
  # resource path
  local_var_path = "/properties/{mlsId}".sub('{format}','json').sub('{' + 'mlsId' + '}', mls_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if opts[:'include']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json', 'application/vnd.simplyrets-v0.1+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Listing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#properties_mls_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end