JS SDK
Retsly Core SDK Version 2. Useful for clientside and node integration with Retsly.
Installation
$ npm install retsly/js-sdk
Usage
var Retsly = var retsly = Retsly;var request = retsly ;
API
Retsly.create(token, [vendor])
Returns a new instance of Retsly
. Requires an API token and optionally set the vendor (the MLS data source).
retsly.listings([query])
Returns a new Request
for the Listings resource.
retsly.agents([query])
Returns a new Request
for the Agents resource.
retsly.offices([query])
Returns a new Request
for the Offices resource.
retsly.openHouses([query])
Returns a new Request
for the Openhouses resource.
request.query(query)
Appends the query to the querystring.
request
request.limit(n)
Alias for request.query({limit: n})
;
request.offset(n)
Alias for request.query({offset: n})
;
request.where(query)
Helper function for building queries, works with different signatures.
request ;
request.get(id, [callback])
Gets a single document with id, optionally takes a callback
request.getAll([query], [callback])
Gets an array of documents that match the query criteria, optionally takes a callback
request.findOne([query], [callback])
Gets a single document that match the optional query criteria, and optionally takes a callback. It sets the limit to one and only return the first result and not an array.
request.findAll([query], [callback])
Alias for request.findAll(query, callback)
request.exec([callback])
Alias for request.findAll({}, callback)
NOTE:
callbacks follow standard node syntax of:
;