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'
config.enable_event_tracking = true
config.gcs_bucket = ENV['_GCS_BUCKET']
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::Residents
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::Prospects 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]with_or [Yardi::Parameter::With_or]
Response
An array of Yardi::Model::Prospects
Example
Yardi::Request::GetYardiGuestActivity.new(
credential: credential,
params: { property_id: 'p263656', prospect: prospect, with_or: with_or }
).perform
# => [#<Yardi::Model::Prospect>, #<Yardi::Model::Prospect>]
Yardi::Model::Prospect
Attributes
first_nameTheProspect's first name according to Yardi's databaselast_nameTheProspect's last name according to Yardi's databaseemailTheProspect's email address according to Yardi's databasephonesAn Array of theProspect's phone numbers, ornilif there are noneeventsAn Array ofYardi::Model::Eventobjectsprospect_idTheProspectid from Yardi's database e.g."p00003693"tenant_idThe 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, follow the instructions here.
Contributing
If you are interested in contributing to this project, please review the contribution guidelines.
Versions
- 4.10.3 Patch for NilClass when building prospect
- 4.10.2 Patch for send_prospect_events in validator
- 4.10.1 Patch for send_prospect_events default value
- 4.10.0 GetYardiGuestActivity uses send_prospect_events parameter
- 4.9.1 Bug fix for request using GetYardiGuestActivity_SearchWithOR which does not need prospect eventing
- 4.9.0 Fix to change get_soap_action to action and add phones to prospect params
- 4.8.4 GetYardiGuestActivity uses a with_or parameter
- 4.8.2 Update EmptyResponse validator to look for Envelope in Xml
- 4.8.1 Update document parser to look for Envelope in Xml
- 4.8.0 Add GetPropertyConfigurations request
- 4.6.10 Update pms_resident and pms_prospect: add unit_name, resident_id and move_in_report_type
- 4.6.0 Add Snowflake eventing for residents and prospects
- 4.2.0 Add ability to build xml to reactivate and update guestcards
- 4.1.1 Fix to change param name of action to guestcard_action
- 4.1.0 Add guestcard action to build xml for active or inactive guestcard
- 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
Eventnodes - 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