Properties

$moxi_works_agent_id

$moxi_works_agent_id : string

Type

string — the Moxi Works Platform ID of the agent moxi_works_agent_id is the Moxi Works Platform ID of the agent which a contact is or is to be associated with. this must be set for any Moxi Works Platform transaction

$partner_contact_id

$partner_contact_id : string

Type

string — your system's unique ID for the contact *your system's* unique ID for the Contact this must be set for any Moxi Works Platform transaction

$contact_name

$contact_name : string

Type

string — -- Default '' the full name of this Contact

$gender

$gender : \MoxiworksPlatform\string,

Type

\MoxiworksPlatform\string, — Enumerated -- a single character 'm' or 'f' or -- Default '' the gender of this Contact. the first initial of either gender type may be used or the full word 'male' or 'female.' <p> <b>note: The single character representation will be used after saving to Moxi Works Platform no matter whether the word or single character representation is passed in.</b>

$home_street_address

$home_street_address : string

Type

string — -- Default '' the street address of the residence of this Contact

$home_city

$home_city : string

Type

string — -- Default '' the city of the residence of this Contact

$home_state

$home_state : string

Type

string — -- Default '' the state in which the residence of this Contact is located this can either be the state's abbreviation or the full name of the state

$home_zip

$home_zip : string

Type

string — -- Default '' the zip code of the residence of this Contact

$home_neighborhood

$home_neighborhood : string

Type

string — -- Default '' the neighborhood of the residence of this Contact

$home_country

$home_country : string

Type

string — -- Default '' the country of the residence of this Contact this can either be the country's abbreviation or the full name of the country

$job_title

$job_title : string

Type

string — -- Default '' the specific job title this contact has; ex: 'Senior VP of Operations'

$note

$note : string

Type

string — -- Default '' human readable notes associated with the contact; ex: 'very interested in Springfield Heights'

$occupation

$occupation : string

Type

string — -- Default '' the general occupation of this contact; ex: 'Software Developer'

$is_new_contact

$is_new_contact : boolean

Type

boolean — Whether the contact was recently added to the Agent's database.

$birthday

$birthday : integer

Type

integer — Birthday of the contact represented as a Unix Timestamp.

$anniversary

$anniversary : integer

Type

integer — Wedding anniversary of the contact represented as a Unix Timestamp.

$home_purchase_anniversary

$home_purchase_anniversary : \MoxiworksPlatform\home_purchase_anniversary

Type

\MoxiworksPlatform\home_purchase_anniversary — Anniversary of the contact's home purchase represented as a Unix Timestamp.

$social_media_profiles

$social_media_profiles : array

Type

array — URLs to any social media profiles that the agent has defined. The structure of each social media profile entry will be an associative array with the following format: { "key" => "KEY_VAL_AS_STRING", "url" => "URL_OF_SOCIAL_MEDIA_PROFILE" }

$partner_agent_id

$partner_agent_id : string

Type

string — -- Default '' your system's unique identifier for the agent that this contact will be associated with

$primary_email_address

$primary_email_address : string

Type

string — -- Default '' the email address the contact would want to be contacted via first

$primary_phone_number

$primary_phone_number : string

Type

string — -- Default '' the phone number the contact would want to be contacted via first

$secondary_email_address

$secondary_email_address : string

Type

string — -- Default '' an additional email address the contact would want to be contacted by

$secondary_phone_number

$secondary_phone_number : string

Type

string — -- Default '' an additional phone number the contact would want to be contacted by

$property_baths

$property_baths : integer

Type

integer — -- Default nil the number of bathrooms in the listing the contact has expressed interest in Property of Interest (POI) attribute

$property_beds

$property_beds : integer

Type

integer — -- Default nil the number of bedrooms in the listing the contact has expressed interest in Property of Interest (POI) attribute

$property_city

$property_city : string

Type

string — -- Default '' the city in which the listing the contact has expressed interest in is located Property of Interest (POI) attribute

$property_list_price

$property_list_price : integer

Type

integer — -- Default nil the list_price of the property the contact has expressed interest in Property of Interest (POI) attribute

$property_listing_status

$property_listing_status : \MoxiworksPlatform\property_listing_status

Type

\MoxiworksPlatform\property_listing_status — Property of Interest (POI) attribute the status of the listing of the Property of Interest; ex: 'Active' or 'Sold'

$property_mls_id

$property_mls_id : \MoxiworksPlatform\property_mls_id

Type

\MoxiworksPlatform\property_mls_id — the MLS ID of the listing that of the Property of Interest Property of Interest (POI) attribute

$property_photo_url

$property_photo_url : \MoxiworksPlatform\property_photo_url

Type

\MoxiworksPlatform\property_photo_url — a full URL to a photo of the Property of Interest Property of Interest (POI) attribute

$property_state

$property_state : \MoxiworksPlatform\property_state

Type

\MoxiworksPlatform\property_state — the state in which the listing the contact has expressed interest in is located Property of Interest (POI) attribute

$property_street_address

$property_street_address : \MoxiworksPlatform\property_street_address

Type

\MoxiworksPlatform\property_street_address — the street address of the listing the contact has expressed interest in is located Property of Interest (POI) attribute

$property_url

$property_url : \MoxiworksPlatform\property_url

Type

\MoxiworksPlatform\property_url — a URL referencing a HTTP(S) location which has information about the listing Property of Interest (POI) attribute

$property_zip

$property_zip : \MoxiworksPlatform\property_zip

Type

\MoxiworksPlatform\property_zip — the zip code in which the listing the contact has expressed interest in is located Property of Interest (POI) attribute

$search_city

$search_city : \MoxiworksPlatform\search_city

Type

\MoxiworksPlatform\search_city — the city which the contact has searched for listings in Property Search (PS) attribute attr_accessor :search_city

$search_state

$search_state : \MoxiworksPlatform\search_state

Type

\MoxiworksPlatform\search_state — the state which the contact has searched for listings in Property Search (PS) attribute

$search_zip

$search_zip : \MoxiworksPlatform\search_zip

Type

\MoxiworksPlatform\search_zip — the zip code which the contact has searched for listings in Property Search (PS) attribute

$search_max_lot_size

$search_max_lot_size : \MoxiworksPlatform\search_max_lot_size

Type

\MoxiworksPlatform\search_max_lot_size — the maximum lot size used by the contact when searching for listings Property Search (PS) attribute

$search_max_price

$search_max_price : integer

Type

integer — -- Default nil the maximum price value used by the contact when searching for listings Property Search (PS) attribute

$search_max_sq_ft

$search_max_sq_ft : integer

Type

integer — -- Default nil the maximum listing square footage used by the contact when searching for listings Property Search (PS) attribute

$search_max_year_built

$search_max_year_built : integer

Type

integer — -- Default nil the maximum year built used by the contact when searching for listings Property Search (PS) attribute

$search_min_baths

$search_min_baths : float

Type

float — -- Default nil Property Search (PS) attribute the minimum number of bathrooms used by the contact when searching for listings

$search_min_beds

$search_min_beds : integer

Type

integer — -- Default nil the minimum number of bedrooms used by the contact when searching for listings Property Search (PS) attribute

$search_min_price

$search_min_price : integer

Type

integer — -- Default nil the minimum price used by the contact when searching for listings Property Search (PS) attribute

$search_min_sq_ft

$search_min_sq_ft : integer

Type

integer — -- Default nil the minimum square footage used by the contact when searching for listings Property Search (PS) attribute

$search_min_year_built

$search_min_year_built : integer

Type

integer — -- Default nil the minimum year built used by the contact when searching for listings Property Search (PS) attribute

$search_property_types

$search_property_types : string

Type

string — -- Default '' the property types used by the contact when searching for listings; ex: 'Condo' 'Single-Family' 'Townhouse' Property Search (PS) attribute

Methods

headers()

headers() 

authHeader()

authHeader() 

acceptHeader()

acceptHeader() 

contentTypeHeader()

contentTypeHeader() 

userAgentHeader()

userAgentHeader() 

apiConnection()

apiConnection(  $method,   $url,   $attributes) 

Parameters

$method
$url
$attributes

checkForErrorInResponse()

checkForErrorInResponse(  $json) 

Parameters

$json

underscore()

underscore(  $attr) 

Parameters

$attr

__construct()

__construct(array  $data) 

Contact constructor.

Parameters

array $data

create()

create(array  $attributes = array()) : \MoxiworksPlatform\Contact|null

Create a Contact on The Moxi Works Platform <code> MoxiworksPlatform\Contact::create([ moxi_works_agent_id: '123abc', partner_contact_id: '1234', contact_name: 'george p warshington', home_street: '123 this way', home_city: 'cittyvile', home_state: 'HI', home_country: 'USA', home_neighborhood: 'my hood', job_title: 'junior bacon burner', occupation: 'chef', note: 'some notable stuff', primary_email_address: 'goo@goo.goo', primary_phone_number: '123213', property_mls_id: '1232312abcv', secondary_phone_number: '1234567890']); </code>

Parameters

array $attributes

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\RemoteRequestFailureException

Returns

\MoxiworksPlatform\Contact|null

find()

find(array  $attributes = array()) : \MoxiworksPlatform\Contact|null

Find a previously created Contact on Moxi Works Platform.

find can be performed including your system's contact id and the Moxi Works Agent ID in a parameter array \MoxiworksPlatform\Contact::find([moxi_works_agent_id: 'abc123', partner_contact_id: 'my_system_contact_id'])

Parameters

array $attributes


moxi_works_agent_id either agent_uuid or moxi_works_agent_id are REQUIRED The Moxi Works Agent ID for the agent to which this contact is associated
agent_uuid either agent_uuid or moxi_works_agent_id are REQUIRED The Moxi Works Agent UUID for the agent to which this contact is associated
partner_contact_id REQUIRED Your system's unique ID for this contact.

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\RemoteRequestFailureException

Returns

\MoxiworksPlatform\Contact|null

search()

search(array  $attributes = array()) : Array

Search for Contact by name/email/phone on Moxi Works Platform.

search can be performed by including contact_name and/or email_address and/or phone_number in a parameter array \MoxiworksPlatform\Contact::search([moxi_works_agent_id: 'abc123', contact_name: 'Buckminster Fuller'])

Parameters

array $attributes


moxi_works_agent_id either agent_uuid or moxi_works_agent_id are REQUIRED The Moxi Works Agent ID for the agent to which this contact is associated
agent_uuid either agent_uuid or moxi_works_agent_id are REQUIRED The Moxi Works Agent UUID for the agent to which this contact is associated
contact_namefull name of the contact
email_addressemail address of the contact
phone_numberphone number of the contact
updated_since return all Contacts updated after this Unix timestamp

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\Exception\ArgumentException

if at least one search parameter is not defined

\MoxiworksPlatform\RemoteRequestFailureException

Returns

Array —

of Contact objects

update()

update(array  $attributes = array()) : \MoxiworksPlatform\Contact|null

Updates a previously created Contact in Moxi Works Platform <code> MoxiworksPlatform\Contact::update([ moxi_works_agent_id: '123abc', partner_contact_id: '1234', contact_name: 'george p warshington', home_street: '123 this way', home_city: 'cittyvile', home_state: 'HI', home_country: 'USA', home_neighborhood: 'my hood', job_title: 'junior bacon burner', occupation: 'chef', note: 'some notable stuff', primary_email_address: 'goo@goo.goo', primary_phone_number: '123213', property_mls_id: '1232312abcv', secondary_phone_number: '1234567890']); </code>

Parameters

array $attributes


moxi_works_agent_id either agent_uuid or moxi_works_agent_id are REQUIRED The Moxi Works Agent ID for the agent to which this contact is associated
agent_uuid either agent_uuid or moxi_works_agent_id are REQUIRED The Moxi Works Agent UUID for the agent to which this contact is associated
partner_contact_id REQUIRED Your system's unique ID for this contact.

  <h2>
optional Contact parameters

 <br><b>contact_name</b>  full name of this contact in format "Firstname Middlename Lastname"
 <br><b>gender </b> can be "male" or "female" or "m" or "f"
 <br><b>home_street_address</b>  the street address and street on which the contact lives
 <br><b>home_city</b>  city or township in which this contact lives
 <br><b>home_state</b>  state in which this contact lives; can be abbreviation or full name
 <br><b>home_zip</b>  zip code in which this contact lives
 <br><b>home_neighborhood</b>  neighborhood in which this contact lives
 <br><b>home_country</b>  country in which this contact lives; can be abbreviation or full name
 <br><b>job_title</b>  the specific job title this contact has; ex  'Senior VP of Operations'
 <br><b>occupation</b> occupation of this contact; ex  'Software Developer'
 <br><b>note</b> Human readable comments about this contact
 <br><b>partner_agent_id</b>  your system's unique ID for the agent this contact is to be associated with
 <br><b>primary_email_address</b>  the primary email address for this contact
 <br><b>primary_phone_number</b>  the primary phone number for this contact
 <br><b>secondary_email_address</b>  the secondary email address for this contact
 <br><b>secondary_phone_number</b>  the secondary phone number for this contact

  <h2>
optional Property of Interest (POI) parameters:
  The POI is a property that the contact has shown interest in.

 <br><b>property_baths</b>  the number of baths in the Property of Interest
 <br><b>property_beds</b>  the number of bedrooms in the Property of Interest
 <br><b>property_city</b>  the city in which the Property of Interest is located
 <br><b>property_list_price</b>  the list price of the Property of Interest
 <br><b>property_listing_status</b>  the status of the Property of Interest; ex: 'Active' or 'Sold'
 <br><b>property_mls_id</b>  the MLS ID of the listing
 <br><b>property_photo_url</b>  a full URL of an image of the Property of Interest
 <br><b>property_state</b>  the state which the Property of Interest is in
 <br><b>property_street_address</b>  the street address that the Property of Interest is on
 <br><b>property_url</b>  a URL to a page with more information about the Property of Interest
 <br><b>property_zip</b>  the zip code which the Property of Interest is in

  <h2>
optional Search Reference parameters:
  The Search Reference parameters reflect search criteria that the contact
    has used while searching for a listing

 <br><b>search_city</b>  the city or locality which this contact has searched for a listing
 <br><b>search_state</b>  the state in which this contact has searched for a listing
 <br><b>search_zip</b>  the zip code or postal code in which this contact has searched for a listing
 <br><b>search_max_lot_size</b>  the maximum lot size that this contact has used as criteria when searching for a listing
 <br><b>search_max_price</b>  the maximum price that this contact has used as criteria when searching for a listing
 <br><b>search_max_sq_ft</b>  the maximum square feet that this contact has used as criteria when searching for a listing
 <br><b>search_max_year_built</b>  the maximum year built this contact has used as criteria when searching for a listing
 <br><b>search_min_baths</b>  the minimum number of baths this contact has used as criteria when searching for a listing
 <br><b>search_min_beds</b>  the minimum number of bedrooms this contact has used as criteria when searching for a listing
 <br><b>search_min_lot_size</b>  the minimum lot size this contact has used as criteria when searching for a listing
 <br><b>search_min_price</b>  the minimum price this contact has used as criteria when searching for a listing
 <br><b>search_min_sq_ft</b>  the minimum number of square feet this contact has used as criteria when searching for a listing
 <br><b>search_min_year_built</b>  the minimum year built this contact has used as criteria when searching for a listing
 <br><b>search_property_types</b>  property types this contact has searched for; ex: 'Single Family, Condo, Townhouse'

Throws

\MoxiworksPlatform\RemoteRequestFailureException

Returns

\MoxiworksPlatform\Contact|null

save()

save() : \MoxiworksPlatform\Contact|null

Save Contact to Moxi Works Platform

$contact = MoxiworksPlatform\Contact::find([ moxi_works_agent_id: '123abc']); $contact->search_city = 'Cityville'; $contact->save();

Returns

\MoxiworksPlatform\Contact|null

delete()

delete() : \MoxiworksPlatform\Contact|null

Remove a contact your system has previously created on the Moxi Works Platform from an agent

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\RemoteRequestFailureException

Returns

\MoxiworksPlatform\Contact|null

sendRequest()

sendRequest(  $method, array  $opts = array(), null  $url = null) : \MoxiworksPlatform\Contact|null

Parameters

$method
array $opts
null $url

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\RemoteRequestFailureException

Returns

\MoxiworksPlatform\Contact|null