LionDesk API Documentation V1



Visit https://developers.liondesk.com for the LionDesk V2 API.

Overview

2/20/2018: The LionDesk v1 API will be shut down. All new development must be done on the new V2 API. https://developers.liondesk.com

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.

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.

Available Calls

GetUsers | NewContact | NewSubmission | NewComment | NewTask | NewActivity | GetAllContacts | GetContactDetails | GetContactActivity

Echo

Used to test communication with the api.

In PHP, the code would look like the following:

$USERKEY = 'afbcdef';
$APIKEY = 'XYZ789';

$url = 'https://api-v1.liondesk.com/';
$data = array(
	'action' => 'Echo',
	'msg' => 'hello world'
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );  
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);

Response:
( [error] => 0 [errorText] => [action] => Echo [msg] => hello world )

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:

$url = 'https://api-v1.liondesk.com/';
$data = array(
	'action' => 'GetUsers'
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );  
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);


Response:
Object ( [error] => 0 [errorText] => [users] => Array ( 
	[0] => Object ( [userKey] => 1a1a1a ) 
	[1] => Object ( [userKey] => 2b2b2b )
	[2] => Object ( [userKey] => 3c3c3c ) 
))

NewContact

The NewContact API will create a new contact in LionDesk without creating a new lead and will not notify the user that a new contact has been created in LionDesk. The NewContact 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.
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.
sourcename LionDesk lead source name. This will attach the source to the contact based on the value here that matches up with LionDesk 'Source' in the user settings. 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 contacts 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, nothing will be submitted and the response from the post will be the existing LionDesk contact id.

In PHP, the code would look like the following:

$url = 'https://api-v1.liondesk.com//';
$data = array(
    'action' => 'NewContat',
    'firstname' => 'Joe',
    'lastname' => 'Smith',
    'comments' => 'API Test',
    'phone' => '555-1212',
    'email' => 'joe@testaddress.com',
    'street_address' => '5937 Darwin Court',
    'city' => 'San Diego',
    'state' => 'CA',
    'zip' => '92025',
    'tag' => 'Buyer,92025,Listings Landing Page',
    'sourcename' => 'Facebook Ad 1',
    'contactid' => '12345',
    'siteid' => '1'
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );  
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);

Response:
Object ( [error] => 0 [errorText] => [id] => 15610101 )

NewSubmission

The NewSubmission API will create a new contact, as well as a new lead that notifies the user and will start any associated drip campaigns in LionDesk. The NewSubmission 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. If matched with a LionDesk user, it will update the contact with the Assigned user. 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.
sourcename LionDesk lead source name. This will start a drip based on the value here that matches up with LionDesk 'Source' on a drip. 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:

$url = 'https://api-v1.liondesk.com//';
$data = array(
	'action' => 'NewSubmission',
	'firstname' => 'Joe',
	'lastname' => 'Smith',
	'comments' => 'API Test',
	'phone' => '555-1212',
	'email' => 'joe@testaddress.com',
	'street_address' => '5937 Darwin Court',
	'city' => 'San Diego',
	'state' => 'CA',
	'zip' => '92025',
	'assigned_user_name' => 'Joe Smith',
	'assigned_user_email' => 'joeassigned@testaddress.com',
	'assigned_user_phone' => '760-123-1234',
	'tag' => 'Buyer,92025,Listings Landing Page',
	'sourcename' => 'Facebook Ad 1',
	'contactid' => '12345',
	'siteid' => '1'
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );  
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);

Response:
Object ( [error] => 0 [errorText] => [id] => 15610101 )

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):

$url = 'https://api-v1.liondesk.com//';
$data = array(
	'action' => 'NewComment',
	'contactid' => 'ldcontactidfromNewSubmission',
	'type' => '5',
	'description' => 'Thank you for your interest, we will be with you soon! ~ David'
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );  
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);

Response:
Object ( [error] => 0 [errorText] => [id] => 5646465 )


NewTask

The NewTask 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.
taskdate Date the task is to be set in UTC Time. Format Example: "2014-10-02T00:00:00Z". Required.
title Short title description of the task. Up to 500 characters. Required.
notes Long description for notes of the details of the task. Up to 5000 characters. Optional.
assignedagent Set the task to the assigned user on the LionDesk contact or set it as the owner of the contact. 1 = assigned agent. 0 = The owner of the contact record is assigned the task. Optional.
remindertype Type of task reminder that you are passing across. 0 = No Reminder, 1 = Email, 2 = Call, 3 = Text. Calls, Texts and Email reminders are deducted from the limits on the main LionDesk user account who is assigning the task. Required.

The result of the call will include an attribute 'id' that represents the ID of the task. Note that tasks must have the liondeskcontactid in order to be added. This will validate the API Key with the ownership of the contact, therefore you cannot add a task 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):

$url = 'https://api-v1.liondesk.com//';
$data = array(
	'action' => 'NewTask',
	'liondeskcontactid' => '123415',
	'taskdate' => '2018-10-05T16:00:00Z',
	'title' => 'Contact this client in regards to the property.'
	'description' => 'Property Description: 123 Main Street, MLS # 1234 2 bedroom 2 Bathrooms.',
	'assignedagent' => '0',
	'remindertype' => '1'
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );  
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);

Response:
Object ( [error] => 0 [errorText] => [id] => 423423 )


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:

$url = 'https://api-v1.liondesk.com//';
$data = array(
	'action' => 'NewActivity',
	'contactid' => 'youruniquecontactid',
	'liondeskcontactid' => 'liondeskidfromNewSubmission',
	'liondeskactivityid' => '1',
	'siteid' => '1',
	'sitedomain' => 'http://www.myarizonaproperties.com',
	'type' => 'search_performed',
	'created' => '2016-03-01T08:41:51+00:00',
	'description' => 'User searched for DC Ranch Homes for sale: http://housesscottsdalearizona.com/dc-ranch-homes-for-sale/'
	'property' =>  array(
		'mls' => 'MLS12345',
		'url' => 'http://www.liondesk.com/property/12345.html',
		'street_address' => '20412 Fortuna Del Sur',
		'city' => 'Escondido',
		'state' => 'CA'
	)
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );  
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);

Response:
Object ( [error] => 0 [errorText] => [id] => 12345 )

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"

GetAllContacts

The GetAllContacts API call includes the following information:
page (required) Since results from this API are paginated you are required to enter the page of the results you want. This will start with 1, then will continue until totalContactsOnPage is less than 40. e.g. 5
sort (optional) JSON object used to sort by any field that is in the response. If present, it must contain sort values.
filter (optional) JSON object used to filter results in the response. If present, it must contain filter values.

In PHP, the code would look like the following:

$url = 'https://api-v1.liondesk.com//';
$data = array(
	'action' => 'GetAllContacts',
	'page' => 1,
	'filters' => Array(
		'search' => 'john',
		'searchoption' => 'any'
	),
	'sort' => Array(
		'key' => 'emailprimary',
		'direction' => 'asc'
	)
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);

Response:
Object ( 
	[error] => 0 
	[errorText] =>  
	[action] => GetAllContacts  
	[msg] => "msg": [{
		"addresses": null,
		"anniversary": "",
		"assigneduserfirstname": "",
		"assigneduserlastname": "",
		"birthday": "",
		"company": "",
		"contactlistids": "^0^",
		"date_created": "1509580616",
		"date_emailstexts": "0",
		"date_last_favorite_property_added": "0",
		"date_last_favorite_property_removed": "0",
		"date_last_property_viewed": "0",
		"date_last_saved_search_added": "0",
		"date_last_saved_search_removed": "0",
		"date_last_search_performed": "1510877309",
		"date_last_user_login": "0",
		"date_lastactivity": "1510860395",
		"date_lastcomment": "0",
		"date_lastphoneactivity": "0",
		"date_lastsitevisit": "1510860395",
		"date_nextaptask_recurring": "0",
		"date_nextaptask_regular": "0",
		"date_nextothercontact": "0",
		"date_nexttask": "0",
		"emailprimary": "",
		"emailsecondary": "",
		"firstname": "John",
		"hotness": " ",
		"hotnesscolor": "#efefef",
		"hotnessid": "0",
		"hotnessrank": "9999",
		"idAssignedUser": "0",
		"idCustomer": "2",
		"idUser": "3",
		"is_private": "0",
		"lastname": "Smith",
		"ownerfirstname": "John",
		"ownerlastname": "Doe",
		"phonefax": "",
		"phonehome": "",
		"phonemobile": "",
		"phoneoffice": "",
		"sharedusers": null,
		"sharedusers_ids": null,
		"sharedusers_total": "0",
		"source": "",
		"sourceid": "0",
		"spousebirthday": "",
		"spouseemail": "",
		"spousename": "",
		"spousephone": "",
		"status": "",
		"statusid": "0",
		"tagnames": "^^",
		"tagnamesid": "2",
		"total_activities": "0",
		"total_aptasks_recurring": "0",
		"total_aptasks_regular": "0",
		"total_comments": "0",
		"total_contactactions": "0",
		"total_emailstexts": "0",
		"total_favorited_properties": "0",
		"total_othercontacts": "0",
		"total_phoneactivity": "0",
		"total_property_views": "0",
		"total_receivedtexts": "0",
		"total_saved_searches": "0",
		"total_searches_performed": "1",
		"total_senttexts": "0",
		"total_sitevisits": "1",
		"total_tasks": "0",
		"total_user_logins": "0",
		"type": "",
		"typeid": "0"
	}],
	[page] => 1,
	[totalContactsOnPage] => 1
)

Sort fields

Field name Type Presence Description Expected values
key string required The key you want to sort by Any value found in the response object above
direction string required The direction you want to sort in, either ascending or descending"asc" or "desc"

Filter fields

Field name Type Presence Description Expected values
datefromlastsitevisit integer optional Starting date for range of last site visit, entered as unix timestampUnix timestamp eg. 1509519600
datetolastsitevisit integer optional Ending date for range of last site visit, entered as unix timestampUnix timestamp eg. 1512115200
mintotalsitevisits integer optional Minimum total of site visits to filter byAny integer eg. 0
maxtotalsitevisits integer optional Maximum total of site visits to filter byAny integer eg. 100
datefromlastuserlogin integer optional Starting date for range of last user login, entered as unix timestampUnix timestamp eg. 1509519600
datetolastuserlogin integer optional Ending date for range of last user login, entered as unix timestampUnix timestamp eg. 1512115200
mintotaluserlogins integer optional Minimum total of user logins to filter byAny integer eg. 0
maxtotaluserlogins integer optional Maximum total of user logins to filter byAny integer eg. 100
datefromlastsearchperformed integer optional Starting date for range of last search performed, entered as unix timestampUnix timestamp eg. 1509519600
datetolastsearchperformed integer optional Ending date for range of last search performed, entered as unix timestampUnix timestamp eg. 1512115200
mintotalsearchesperformed integer optional Minimum total of searches performed to filter byAny integer eg. 0
maxtotalsearchesperformed integer optional Maximum total of searches performed to filter byAny integer eg. 100
datefromlastsavedsearchadded integer optional Starting date for range of last saved search added, entered as unix timestampUnix timestamp eg. 1509519600
datetolastsavedsearchadded integer optional Ending date for range of last saved search added, entered as unix timestampUnix timestamp eg. 1512115200
datefromlastsavedsearchremoved integer optional Starting date for range of last saved search removed, entered as unix timestampUnix timestamp eg. 1509519600
datetolastsavedsearchremoved integer optional Ending date for range of last saved search removed, entered as unix timestampUnix timestamp eg. 1512115200
mintotalsavedsearches integer optional Minimum total of saved searches to filter byAny integer eg. 0
maxtotalsavedsearches integer optional Maximum total of saved searches searches to filter byAny integer eg. 100
datefromlastpropertyviewed integer optional Starting date for range of last property viewed, entered as unix timestampUnix timestamp eg. 1509519600
datetolastpropertyviewed integer optional Ending date for range of last property viewed, entered as unix timestampUnix timestamp eg. 1512115200
mintotalpropertyviews integer optional Minimum total of property views to filter byAny integer eg. 0
maxtotalpropertyviews integer optional Maximum total of property views to filter byAny integer eg. 100
datefromlastfavoritepropertyadded integer optional Starting date for range of last favorited property added entered as unix timestampUnix timestamp eg. 1509519600
datetolastfavoritepropertyadded integer optional Ending date for range of last favorited property added, entered as unix timestampUnix timestamp eg. 1512115200
datefromlastfavoritepropertyremoved integer optional Starting date for range of last favorited property removed, entered as unix timestampUnix timestamp eg. 1509519600
datetolastfavoritepropertyremoved integer optional Ending date for range of last favorited property removed, entered as unix timestampUnix timestamp eg. 1512115200
mintotalfavoritedproperties integer optional Minimum total of favorited properties to filter byAny integer eg. 0
maxtotalfavoritedproperties integer optional Maximum total of favorited properties searches to filter byAny integer eg. 100
nofuturecampaign string optional Turn on to filter for contacts with no future campaign The only available value is "on"
nofuturetask string optional Turn on to filter for contacts with no future task The only available value is "on"
hotnessstringoptionalHotness of a contact, separated by ^, 0 means hotness not specified0, hot, warm, cold
tagnamesstringoptionalName of the tag in the UI as lower case separated by ^
tagoptionstringoptionalAND or OR, depending on if you need some or all tagnames specified for filteringAND, OR
datefromcontactedintegeroptionalStarting date for range of last email/text sent, entered as unix timestampUnix timestamp eg. 1509519600
datetocontactedintegeroptionalEnding date for range of last email/text sent, entered as unix timestampUnix timestamp eg. 1512115200
mincontactedintegeroptionalMinumum starting range for number of times emailed/textedAny integer eg. 0
maxcontactedintegeroptionalMaximum ending range for number of times emailed/textedAny integer eg. 1000
commentdatefromcontactedintegeroptionalStarting date for range of last commented, entered as unix timestampUnix timestamp eg. 1509519600
commentdatetocontactedintegeroptionalEnding date for range of last commented, entered as unix timestampUnix timestamp eg. 1512115200
commentmincontactedintegeroptionalMinimum number of times commentedAny integer eg. 0
commentmaxcontactedintegeroptionalMaximum number of times commentedAny integer eg. 1000
textrepliesmincontactedintegeroptionalMinimum number of text replies from contactsAny integer eg. 0
textrepliesmaxcontactedintegeroptionalMaximum number of text replies from contactsAny integer eg. 1000
textsentmincontactedintegeroptionalMinimum number of texts sent to contactsAny integer eg. 0
textsentmaxcontactedintegeroptionalMaximum number of texts sent to contactsAny integer eg. 1000
othercontactdatestringoptionalPossible way to filter by other dates, refer to 'Other Contact Dates' dropdown in the UI
otherdatefromcontactedintegeroptionalStarting date for range of other contact date, entered as unix timestampUnix timestamp eg. 1509519600
otherdatetocontactedintegeroptionalStarting date for range of other contact date, entered as unix timestampUnix timestamp eg. 1512115200
searchstringoptionalName of the search termA string eg. John
searchoptionstringoptionalStritness level of the searchany, all, exact
sourcestringoptionalSource of the contact, separated by ^facebook, friend/family referral, my website, realtor.com, trulia, zillow
statusstringoptionalStatus of the contact, separated by ^new, prospecting, active, future, closed/inactive, non-client
typestringoptionalType of contactagent, appraiser, client, inspector, lender, title

GetContactDetails

The GetContactDetails API call returns an array of the main details of the LionDesk contact.

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.

In PHP, the code would look like the following:

$url = 'https://api-v1.liondesk.com//';
$data = array(
	'action' => 'GetContactDetails',
	'liondeskcontactid' => 'liondeskidfromNewSubmission'
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);

Response:
Object ( [error] => 0 [errorText] =>  [action] => GetContactDetails  [msg] => "msg": {
	"id": "1",
	"iduser": "1",
	"idassigneduser": "0",
	"isprivate": "0",
	"idshareduser": null,
	"agentfirstname": "David",
	"agentlastname": "Anderson",
	"assignedagentfirstname": "Sierra",
	"assignedagentlastname": "Meccariello",
	"owneruserid": "12",
	"idcustomertype": null,
	"textcustomertype": null,
	"contactsource": "Zillow",
	"idcontactsource": "1",
	"idleadstatustype": "4",
	"leadstatus": "Active",
	"idleadstatus": null,
	"partnercontactid": "123123-12341234-ABC-ABC",
	"idemaillist": null,
	"lastcontactdate": "1505423031",
	"firstname": "Contact Name",
	"lastname": "Contact Last Name",
	"email": "sampleemail@email.com",
	"secondaryemail": "",
	"company": "",
	"birthday": "",
	"anniversary": "",
	"phone": "1231231234",
	"homephone": "",
	"officephone": "",
	"hotnesscolor": "#fbe983",
	"hotness": "Monthly",
	"hotnessid": "651616",
	"idhotnesstype": "28591",
	"spousename": "",
	"spouseemail": null,
	"spousephone": null,
	"spousebirthday": null
})


GetContactActivity

The GetContactActivity API call returns an array of activity from a contact. The result of the call will be the array of all activities. To include multiple activity types, separate values by comma.

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.
startdate Pull activity created after a specific date. Formatted as UTC Date/Time. Optional
enddate Pull activity created before a specific date. Formatted as UTC Date/Time. Optional
activitytype Type(s) of activity. Required


Activity ID's/Types:
1 Contact Comments
2 Email Opened
3 Email Clicked
4 Email Sent
5 Text Sent
6 Outbound Click to Call
7 Inbound Call
8 Text Received
9 Sent Letter
10 Sent Postcard
11 Power Dialer Disposition
12 Email Received
13 Email Sent via 3rd Party
14 Lead Assigned
15 Lead Claimed
102 Website Activity

In PHP, the code would look like the following:

$url = 'https://api-v1.liondesk.com//';
$data = array(
	'action' => 'GetContactActivity',
	'liondeskcontactid' => 'liondeskidfromNewSubmission',
	'activitytype' => '1,2,3,4',
	'startdate' => '2018-01-01T08:41:51Z',
	'enddate' => '2018-04-01T08:41:51Z'
);
$content = json_encode($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_USERPWD, $APIKEY . ":" . "" );  
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-LionDesk-Id: '.$USERKEY
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$res = json_decode($result);
print_r($res);
curl_close($ch);

Response:
Object ( [error] => 0 [errorText] =>  [action] => GetContactActivity  [msg] => "msg": {	
	"id":"1",
	"theday":"Sep 14, 2017",
	"thedaygroup":"Sep 14, 2017",
	"commentid":"2",
	"idcustomeractivitytype":"1",
	"activitytype":"Contact Comments",
	"firstname":"Sierra",
	"lastname":"Meccariello",
	"comment":"New comment added by Sierra for a test",
	"date":"Sep 14 2017 09:03 PM",
	"unixdate":"1505423031",
	"thetime":"09:03 PM",
	"totalrecs":1
})

Ready to begin using LionDesk with your Agency?

Get LionDesk Now

Copyright @ 2018 LionDesk, LLC