Follow

LionDesk API Documentation

Overview

The LionDesk API partners are able to send new contact submissions directly to a users LionDesk account. All communication must be made privately from their server using a private APIKEY. Individual LionDesk users must authorize the partner to send them information via the API. LionDesk users have the option to allow a particular partner to access the API with their account. When this authorization occurs they receive a unique USERKEY. This USERKEY is then given to the partner via the various API calls. To view the original article, click here.

Technical

API calls are made over SSL to a specific endpoint. The partner APIKEY is sent in the username field using Basic Authentication. The password should be set to empty. The USERKEY is sent in a custom header 'X-LionDesk-Id'. The Content-Type header should be set to 'application/json'. Data is sent using POST as a JSON object. The JSON object must include an attribute 'action' whose value is the API function you are calling. For testing purposes, there is a simple 'Echo' API call that doesn't not affect any data in LionDesk. The result of an API call is a JSON object with an attribute 'error'. If the value is 0 there was no error. Specific API calls may also return other values.

All users may set up their own personal access to the API by enabling the "Personal" partner in the settings area of their LionDesk application. The APIKEY for the personal access is "user." The "Personal" may not execute the GetUsers call. All other instructions are the same.

 

Echo

Used to test communication with the api.

In PHP, the code would look like the following:

Echo.png

GetUsers

The GetUsers API call returns an array of users who have authorized the partner for API submissions. Each object in the users array contains a valid USERKEY and email address of the LionDesk user that has authorized the partner to use the API on their behalf. All submissions to the API require the USERKEY. The result of the call will be an attribute 'users' that contains the array of users.

In PHP, the code would look like the following:

GetUsers.png

NewSubmission

The NewSubmission API call includes the following information:
firstname First name of the person who submitted the request. Up to 255 characters. May be empty.
lastname Last name of the person who submitted the request. Up to 255 characters. May be empty.
phone Phone number of the person who submitted the request. Up to 50 characters. May be empty.
email Email address of the person who submitted the request. Up to 50 characters. May be empty.
street_address Street address of the person who submitted the request. Up to 50 characters. May be empty.
city City of the person who submitted the request. Up to 100 characters. May be empty.
state State/Province of the person who submitted the request. Up to 50 characters. May be empty.
zip Zip/Postal Code of the person who submitted the request. Up to 50 characters. May be empty.
assigned user name Full name of the user who the lead is assigned to/claimed. Up to 50 characters. May be empty.
assigned user email Email address of the user who the lead is assigned to/claimed. Up to 50 characters. May be empty.
assigned user phone Phone number of the user who the lead is assigned to/claimed. Up to 50 characters. May be empty.
siteid The ID of your site/domain. Used if your users have different sites/domains associated to their account. Up to 50 characters. May be empty.
tag Pass across a Comma Delimited field of 'Tags' that can be used by the end user to filter their contacts in LionDesk. Up to 255 characters. May be empty.
contactid The unique ID of the contact (from your platform). Used so that subsequent Activities can be associated with this contact. Up to 50 characters. May be empty.
comments Comments. Up to 5000 characters. May be empty.
The result of the call will include an attribute 'id' that represents the ID of the LionDesk contact id. Note that submissions must have either a phone number or email address to be entered successfully.

LionDesk will try to match up either the email address, or the phone number to an existing contact. If it finds an existing record, the only data that will be submitted will be the comments field for the exiting contact in LionDesk.

In PHP, the code would look like the following:

NewSubmission.png

NewComment

The NewComment API call includes the following information:
liondeskcontactid LionDesk contactID that is passed back to you from NewSubmission post. If you are creating a new contact in LionDesk and want to pass additional activity in the future, save this ID and then use for this post. Required if not passing contactid (below).
contactid If you are creating contacts from your end (via IDX website for example), this is your contact id that is associated with the NewSubmission. Up to 50 characters. Required if not passing liondeskcontactid.
description Human readable text in relation to the activity performed that will be attached to the contact profile. Up to 2000 characters. Optional.
type Type of activity that you are passing across. Currently, the following are accepted. 1 = Standard Comment, 5 = Text Message Sent, 8 = Text Message Received Required.

The result of the call will include an attribute 'id' that represents the ID of the activity. Note that activities must have the contactid or liondeskcontactid in order to be added. This will validate the API Key with the ownership of the contact, therefore you cannot add an activity to a record where the user does not own, or is assigned to the contact in LionDesk.

In PHP, the code would look like the following if you had the LionDesk contact id (liondeskcontactid):

NewComment.png

NewActivity

The NewActivity API call includes the following information:
liondeskcontactid LionDesk contactID that is passed back to you from NewSubmission post. If you are creating a new contact in LionDesk and want to pass additional activity in the future, save this ID and then use for this post. Required if not passing contactid.
contactid Your contact id that is associated with the NewSubmission contact ID that you pass across to LionDesk. Up to 50 characters. Required if not passing liondeskcontactid.
siteid Your unique site ID. Up to 255 characters. May be empty.
sitedomain Domain request is coming from. Up to 255 characters. May be empty.
description Human readable text in relation to the activity performed that will be attached to the contact profile. Up to 2000 characters. Optional.
type Type of activity. The following types are permitted "visit", "user_login", "search_performed", "saved_search_added", "saved_search_removed", "property_viewed, "favorite_property_added", "favorite_property_removed". Required.
created Timestamp of when this activity was created, usion ISO 8601, ex: "2015-04-01T08:41:51+00:00" May be empty.
property If present, it must contain PROPERTY values. May be empty.

The result of the call will include an attribute 'id' that represents the ID of the activity. Note that activities must have the contactid.

In PHP, the code would look like the following:

NewActivity.png

Property fields

Field name Type Presence Description
mls string optional MLS number
url string optional Full absolute url to visualize property
street_address string optional Street portion of the address, ex: "123 Keolu Rd Unit 12"
city string optional  
state string optional  
zip string optional  
beds integer optional Number of bedrooms
full_baths integer optional Number of full bathrooms
half_baths integer optional Number of half bathrooms
type string optional Human readable type, ex: "Single Family Home" or "Condo"
sqft string optional Property square feet, has no format requirement
listing_price string optional If the property is being sold this is the price it's being listed for. The supported format is a number with optional decimal places, ex.: "100500" or "100500.90"
listing_status string optional If the property is being sold this is the current status, any format is allowed. ex.: "For Sale"
listing_days_on_market integer optional If the property is being sold, how long it's been in the market
estimated_value string optional Estimated value this property could be sold for, useful for Seller or Potential Seller leads. Could be from an automated or personalized valuation. The supported format is a number with optional decimal places, ex.: "100500" or "100500.90"
last_sold_date string optional Doesn't have any format requirement, could be something like "2015-12-25"
last_sold_price string optional If present will be a number with optional decimal places, ex.: "100500" or "100500.90"
latitude float optional  
longitude float optional  
images []string optional List of images urls of this property
year_built int optional The year this property was built
list_date string optional Date when this property was listed. Example: "2014-10-02T00:00:00Z"
Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request

Comments