Preferences
Deprecated
You will receive a warning header as a deprecated notice.
These endpoints are now deprecated, please use /leads
endpoint with your preference wrapped with lead data.
Get Preference
- Endpoint:
GET /leads/{lead_id}/preferences/{id}
- Allowed for:
users that has right lead.read
- JSON response :
Name | Type | Read-only | Comment |
---|---|---|---|
id | integer | yes | Automatically assigned when the lead is created |
lead | Lead | no | Lead attached to the reference (not expanded by default) |
type | Type | no | type of the preference |
location | string | no | Location ID of the preference |
from_price | integer | no | Min price |
to_price | integer | no | Max price |
from_size | integer | no | Min size |
to_size | integer | no | Max size |
from_bathroom | integer | no | Min bathroom |
to_bathroom | integer | no | Max bathroom |
from_bedroom | integer | no | Min bedroom |
to_bedroom | integer | no | Max bedroom |
created_at | datetime | yes | Preference creation date (W3C format) |
updated_at | datetime | yes | Preference updated date (W3C format) |
Additional fields available with the expand headers:
Name | Type | Read-only | Comment |
---|---|---|---|
lead | Lead | no | Full object |
matches | Property[] | no | array of Full object |
- JSON response example:
{
"preference": {
"id": 35,
"lead": {
"id": 35436
},
"location": "are.2.15",
"from_price": 120000,
"to_price": 125000,
"from_size": 900,
"to_size": 1200,
"from_bathroom": 2,
"to_bathroom": 3,
"from_bedroom": 2,
"to_bedroom": 3,
"type": {
"id":2,
"name": "Apartment"
},
"created_at": "2009-07-20T22:55:29Z",
"updated_at": "2011-05-05T10:38:52Z",
}
}
Create Preference
- Endpoint:
POST /leads/{lead_id}/preferences
- Allowed for:
users that has right lead.update
- JSON request
Name | Type | Mandatory | Comment |
---|---|---|---|
location | string | yes | Location id |
type | id | yes | Type id |
from_price | integer | yes | Min price (min value is 100) |
to_price | integer | yes | Max price |
from_size | integer | no | Min size (min size is 0) |
to_size | integer | no | Max size |
from_bathroom | integer | no | Min bathroom (min value is 0) |
to_bathroom | integer | no | Max bathroom (up to 12) |
from_bedroom | integer | no | Min bedroom (min value is 0) |
to_bedroom | integer | no | Max bedroom (up to 12) |
- JSON response:
This endpoint will return a Preference.
Update Preference
- Endpoint:
PUT /leads/{lead_id}/preferences/{id}
- Allowed for:
users that has right lead.update
- JSON request
The mandatory fields are similar than property creation.
- JSON response:
This endpoint will return a Preference.
Delete Preference
- Endpoint:
DELETE /leads/{lead_id}/preferences/{id}
- Allowed for:
users that has right lead.update
- JSON response:
This endpoint will return a 204 http code if success.