yardi
A Ruby client for v4 of Yardi's Guestcard (and soon ILS) API
Installation
Add this line to your application's Gemfile:
gem 'yardi'
And then re-install your application's bundle:
$ bundle install
Or install it yourself as:
$ gem install yardi
Usage
Configuration
Configure the gem with your Yardi license, entity and platform:
Yardi.configure do |config|
# Use your web service URL below
config.license_key = ENV['LICENSE_KEY']
config.entity = 'Apartment List'
config.platform = 'SQL Server'
end
Useful classes
Yardi::Credential
Yardi SOAP actions require authentication so the SOAP action classes
(see below) require a :credential
parameter in the initializer.
credential = Yardi::Credential.new(
username: 'my-username',
password: 'my-password',
database: 'test_db_live',
server: '0SQL_DBtest'
)
params = {
agent: Agent.new(first_name: 'Test', last_name: 'Agent'),
credential: credential,
... # any other required params
}
response = Yardi::Request::SomeSoapAction.new(params).perform
SOAP Actions
To request an action, instantiate the appropriate class (see below) and invoke
#perform
on it. The API response will be parsed and returned as a ruby object.
Yardi::Action::ImportYardiGuest_Login
Insert a guest card into Yardi's system.
Initialization parameters
agent [Yardi::Parameter::Agent]
credential [Yardi::Parameter::Credential]
information needed to authenticate with Yardilead_source [String]
what Yardi calls TransactionSourcereason [String]
what Yardi calls Event Reasons. This is the reason for the event, e.g. price inquiry, tour, etc.property [Yardi::Parameter::Property]
the property to associate the guest card withuser [Yardi::Parameter::User]
the user to associate the guest card with
Yardi::Request::GetResidents
Get all the residents for a given property ID.
Initialization parameters
credential [Yardi::Parameter::Credential]
information needed to authenticate with Yardiproperty_id [String]
the remoteYardiPropertyId
Response
An array of Yardi::Model::Resident
s
Example
Yardi::Request::GetResidents.new(
credential: credential, params: { property_id: 'p263656'}
).perform
=>
[
#<Yardi::Model::Resident:0x007fe922f01d98
@email="[email protected]",
@first_name="James",
@last_name="Bond",
@lease_id="sprng007",
@lease_lead_id="p0012007",
@move_in_date="12/23/2014",
@phones=[
{
"PhoneType" => "home",
"PhoneDescription" => "Home",
"PhoneNumber" => "(123) 456-7890"
}
],
@status="Current",
@unit_name="A2"
>,
#<Yardi::Model::Resident:0x007fe922f01d48
@email="[email protected]",
@first_name="Jason",
@last_name="Bourne",
@lease_id="sprng456",
@lease_lead_id="p0041571",
@move_in_date="10/13/2016",
@phones=[
{
"PhoneType" => "cell",
"PhoneDescription" => "Mobile",
"PhoneNumber" => "8507742326"
}
],
@status="Current",
@unit_name="A3"
>
]
Yardi::Request::GetYardiGuestActivity
Get a list of Yardi::Model::Prospect
s for a given Prospect at the specified property ID.
Initialization parameters
credential [Yardi::Parameter::Credential]
information needed to authenticate with Yardiparams [Hash]
property_id [String]
prospect [Yardi::Parameter::Prospect]
Response
An array of Yardi::Model::Prospect
s
Example
Yardi::Request::GetYardiGuestActivity.new(
credential: credential,
params: { property_id: 'p263656', prospect: prospect }
).perform
# => [#<Yardi::Model::Prospect>, #<Yardi::Model::Prospect>]
Yardi::Model::Prospect
Attributes
first_name
TheProspect
's first name according to Yardi's databaselast_name
TheProspect
's last name according to Yardi's databaseemail
TheProspect
's email address according to Yardi's databasephones
An Array of theProspect
's phone numbers, ornil
if there are noneevents
An Array ofYardi::Model::Event
objectsprospect_id
TheProspect
id from Yardi's database e.g."p00003693"
tenant_id
The tenant id from Yardi's database e.g."t000456"
Development
To install this gem onto your local machine, run bundle exec rake install
.
To release a new version, update the version number in version.rb
, and then
run bundle exec rake release
to create a git tag for the version, push git
commits and tags, and push the .gem
file to
rubygems.org.
Contributing
If you are interested in contributing to this project, please review the contribution guidelines.
Versions
- 4.0.0 Add handling for 404 errors and move ConnectionError to be a subclass of Yardi::Error::Base
- 3.1.2 Fix Prospect parsing to properly handle missing
Event
nodes - 3.1.1 Fix roommate parsing to properly extract roommate data from GetResidents response
- 3.1.0 Add roommates to Resident Model and Parser
- 3.0.6 Handle Yardi connection errors
- 3.0.5 Handle missing event ids
- 3.0.4 Add GuestsNotFound Error
- 3.0.3 Handle roommates in prospect search results
- 3.0.2 Raise an error when GetResidents call returns no Residents
- 3.0.1 Handle parsing resident response when there is only one result
- 3.0.0 GetYardiGuestActivity returns an Array of Prospects
- 2.0.0 GetYardiGuestActivity uses a Prospect parameter
- 1.0.3 Fix when GetResidents call returns nil dates
- 1.0.2 Fix when GetResidents call returns a single phone number
- 1.0.1 Fix when GetResidents call returns nil phone numbers
- 1.0.0 Change response for GetYardiGuestActivity to be an array of Events instead of Tours. Also add lease dates GetResidents response.
- 0.3.0 Add GetResidents request
- 0.2.1 Handle when Yardi's response is completely empty
- 0.2.0 Insert FirstContact events as Email instead of Other
- 0.1.5 Handle missing bed/price preferences
- 0.1.4 Fix Prospect search, which requires a property ID
- 0.1.3 Fetch existing tours from Yardi
- 0.1.2 Support custom connections for use with a proxy
- 0.1.1 Handle multiple errors in the response
- 0.1.0 Initial release with guestcard insertion and response handling