Event Properties
The V1 API events endpoint, previously referred to as Activities, included a property field. In the V2 API an event property is considered its own resource and has been seperated into a new endpoint.
The following fields relate to the Event Properties endpoint.
Field | Limits | Required? | Writeable? |
---|---|---|---|
api_event_id | Automatically set as the event source_id | Yes | No |
contact_id | Automatically set as the event contact_id | Yes | No |
mls | string | No | Yes |
url | 200 characters | No | Yes |
address | 200 characters | No | Yes |
Street portion of the address, e.g. '123 Keolu Rd Unit 12' | |||
city | 200 characters | No | Yes |
state | 200 characters | No | Yes |
zip | 200 characters | No | Yes |
beds | integer | No | Yes |
full_baths | integer | No | Yes |
half_baths | integer | No | No |
type | 45 characters | No | Yes |
Human readable type, e.g. 'Single Family Home' or 'Condo' | |||
square_feet | 45 characters | No | Yes |
Property square feet, has no format requirement | |||
listing_price | A number with optional decimal places, e.g. '100500' or '100500.90' | No | Yes |
listing_status | 45 characters | No | Yes |
If the property is being sold this is the current status, any format is allowed. e.g. 'For Sale' | |||
listing_days_on_market | integer | No | Yes |
estimated_value | A number with optional decimal places, e.g. '100500' or '100500.90' | No | Yes |
last_sold_at | date-time | No | Yes |
last_sold_price | A number with optional decimal places, e.g. '100500' or '100500.90' | No | Yes |
latitude | Float | No | Yes |
longitude | Float | No | Yes |
images | Comma seperated list upto 255 characters | No | Yes |
year_built | integer | No | Yes |
listed_at | date-time | No | Yes |
Event Properties Permissions
Event Properties can only be associated with Events that have a source: api.
To Submit, Get, or Find event properties, the user must have access to the event properties' contact. The user can have access to a contact in one of the following ways:
- owner of the contact
- assigned to the contact
- teammate of the contact owner if team sharing is on
- shared by the user's broker
To Update or Remove event properties the user must be the owner of the event properties' contact.
Submit one Event Property
To submit one event property:
POST https://api-v2.liondesk.com//events/7/properties
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
The request object should have this form:{
"mls": "1021712",
"url": "https://www.fakerealestate.com/fake-listings/1021712",
"address": "123 Real Street",
"city": "San Diego",
"state": "CA",
"zip": "90210",
"beds": "1",
"full_baths": "1",
"type": "Single Family Home",
"square_feet": "10,000",
"listing_price": "499900.00",
"listing_status": "For Sale",
"listing_days_on_market": "100",
"estimated_value": "500000.00",
"last_sold_at": "2018-02-16T08:00:00.000Z",
"last_sold_price": "202580",
"latitude": "40.760612",
"longitude": "-121.269237",
"images": "http://lorempixel.com/640/480/",
"year_built": "2018",
"listed_at": "2017-02-16T08:00:00.000Z"
}
Update one Event Property
To update some attributes on one event property:
PATCH https://api-v2.liondesk.com//events/7/properties/10
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
data: { mls: "1021712", url: "https://www.fakerealestate.com/fake-listings/1021712"}
Get One Event Property
To get one event property:
GET https://api-v2.liondesk.com//events/7/properties/1
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
The response object will have this form:{
"api_event_id": "7",
"contact_id": "1",
"mls": "1021712",
"url": "https://www.fakerealestate.com/fake-listings/1021712",
"address": "123 Real Street",
"city": "San Diego",
"state": "CA",
"zip": "90210",
"beds": "1",
"full_baths": "1",
"half_baths": "2",
"type": "Single Family Home",
"square_feet": "10,000",
"listing_price": "499900.00",
"listing_status": "For Sale",
"listing_days_on_market": "100",
"estimated_value": "500000.00",
"last_sold_at": "2018-02-16T08:00:00.000Z",
"last_sold_price": "202580",
"latitude": "40.760612",
"longitude": "-121.269237",
"images": "http://lorempixel.com/640/480/",
"year_built": "2018",
"listed_at": "2017-02-16T08:00:00.000Z"
}
Find All Event Properties
You find/search event properties by issuing a GET
request to the base endpoint:
GET https://api-v2.liondesk.com//events/7/properties
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
The response will contain an array of event property objects, like so:
{
"total": 2,
"limit": 10,
"skip": 0,
"data": [
{
"api_event_id": "7",
"contact_id": "1",
"mls": "1021712",
"url": "https://www.fakerealestate.com/fake-listings/1021712",
"address": "123 Real Street",
"city": "San Diego",
"state": "CA",
"zip": "90210",
"beds": "1",
"full_baths": "1",
"half_baths": "2",
"type": "Single Family Home",
"square_feet": "10,000",
"listing_price": "499900.00",
"listing_status": "For Sale",
"listing_days_on_market": "100",
"estimated_value": "500000.00",
"last_sold_at": "2018-02-16T08:00:00.000Z",
"last_sold_price": "202580",
"latitude": "40.760612",
"longitude": "-121.269237",
"images": "http://lorempixel.com/640/480/",
"year_built": "2018",
"listed_at": "2017-02-16T08:00:00.000Z"
},
{
"api_event_id": "7",
"contact_id": "2",
"mls": "7661634",
"url": "https://www.fakerealestate.com/fake-listings/7661634",
"address": "345 Fake Street",
"city": "Vancouver",
"state": "WA",
"zip": "98105",
"beds": "2",
"full_baths": "2",
"half_baths": "1",
"type": "Condo",
"square_feet": "20000",
"listing_price": "135000",
"listing_status": "Sold",
"listing_days_on_market": "1",
"estimated_value": "150000",
"last_sold_at": "2019-02-16T08:00:00.000Z",
"last_sold_price": "510000",
"latitude": "37.303288",
"longitude": "-82.492884",
"images": "http://lorempixel.com/640/480/, http://lorempixel.com/480/640/",
"year_built": "2009",
"listed_at": "2018-02-16T08:00:00.000Z"
}
]
}
Filtering Event Properties
The following filtering operators may be mixed and matched as desired.
Equality
You may query event property fields directly by specifying equality parameters in the request URI:GET /events/7/properties?mls=1021712&state=WA
You may wish to exclude results having some value with $ne:GET /events/7/properties?state[$ne]=WA
Dates & Times
Unless otherwise stated all dates and times should be in ISO8601 format. Examples: 2012-09-27, 2012-09-27T09:15:00Z (UTC), 2012-09-27T09:15:00-07:00 (PDT)
Limiting and Pagination
$limit will return only the number of results you specify: GET /events/7/properties?$limit=2
$skip will skip the specified number of results, useful for paginating:GET /events/7/properties?state=WA&$limit=2&$skip=2
Sorting
$sort will order results based on the field given.
Use 1 for ascending order, and -1 for descending order:GET /events/7/properties?$limit=10&$sort[created_at]=-1
Inclusion / Exclusion
Find all records where the property values are ($in) some set:GET /events/7/properties?MLS[$in]=WA&MLS[$in]=CA
If the column matches any of the given values, the resource shall be returned.
Similarly, you may exclude certain values with ($nin):GET /events/7/properties?MLS[$nin]=WA&MLS[$nin]=CA
Remove
Event Properties can be removed with a delete request.
DELETE https://api-v2.liondesk.com//events/7/properties/153
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}