Get Landlord
- Endpoint:
GET /landlords/{id}
- Allowed for:
users that has right landlord.read
- Filters :
Name | Comment | Value |
---|---|---|
excluded_user | returns all users properties except the given user id | ex: 3 |
user | filter by the given user id | ex: 3 |
query | filter on id, last name, first name, mobile and email | ex: "David P" |
id | filter on landlord id | ex: 2 |
name | filter on last name, first name | ex: Jon |
mobile | filter on mobile | ex: +33 |
filter on email | ex: test@mycrm.com | |
updated | filter on updated date. An array or an defined interval. | ex: 'from' => '2016-01-01', 'to' => '2017-01-01', or 'current_month' |
identity_number | filter on passport | ex: RDR7800 |
passport | filter on passport | ex: RDR7800 |
passport_expire | filter on passpert expire date. An array or an defined interval. | ex: 'from' => '2016-01-01', 'to' => '2017-01-01', or 'current_month' |
birthdate | filter on passpert expire date. An array or an defined interval. | ex: 'from' => '2016-01-01', 'to' => '2017-01-01', or 'current_month' |
address | filter on address | ex: jlt |
pobox | filter on pobox | ex: 11987 |
city | filter on city | ex: dubai |
country | filter on country (2 chars) | ex: AE |
nationality | filter on country (2 chars) | ex: AE |
legal_representative[name] | filter on last name, first name | ex: shi sha |
legal_representative[mobile] | filter on mobile or phone | ex: shi sha |
legal_representative[email] | filter on email | ex: shi.sha@gmail.com |
family_info[name] | filter on name | ex: shireen |
family_info[children] | filter on childern (0-20) | ex: 2 |
family_info[marital_status] | filter on marital status ('married', 'single') | ex: single |
second_buyer[name] | filter on last name, first name | ex: shi sha |
second_buyer[mobile] | filter on mobile or phone | ex: shi sha |
second_buyer[email] | filter on email | ex: shi.sha@gmail.com |
second_buyer[relation] | filter on reletion('spouse', 'companion', 'husband', 'friend', 'parent', 'sibling', 'child', 'business_partner', 'business_partner', 'investor', 'other') | ex: friend |
property_fields | filter on custom fields added in property | ex: fields => ['1' =>'shi'] |
landlord_fields | filter on custom fields added in landlord | ex: landlord_fields => ['1' =>'shi'] |
Curl example :
$ curl -X GET 'http://api-v2.mycrm.com/landlords?filters[client]=1'
Curl example with custom fields:
$ curl -X GET 'http://api-v2.mycrm.com/landlords?filters[landlord_fields]['1']=test&$filters[property_fields]['2']=test'
- Sorts (possible values are ASC or DESC for all sorts). Default value is ASC:
Name |
---|
id |
last_name |
mobile |
user |
created |
Curl example :
$ curl -X GET 'http://api-v2.mycrm.com/landlords?sort=id&sort_order=DESC'
- JSON request data:
Name | Type | Read-only | Comment |
---|---|---|---|
id | integer | yes | Automatically assigned when the landlord is created |
title | string | no | Title of the agent (Mrs, Miss, Mr) |
first_name | string | no | Landlord first name |
middle_name | string | no | Landlord middle name |
last_name | string | no | Landlord last name |
string | no | Client email | |
mobile | string | no | The landlords mobile phone |
address | string | no | The landlords address |
pobox | string | no | The lead's pobox / postalcode |
city | string | no | The lead's city |
passport | string | no | The landlords passport ID |
passport_expired_at | date | no | Expiration date of the passport |
user | User | no | User attached to the given landlord |
birth_date | date | no | Landlord's birth date (W3C format) |
nationality | string | no | Landlord's nationality (W3F format: 3Letters) |
country | string | no | Landlord's country (W3F format: 3Letters) |
created_at | date | yes | Landlord creation date (W3C format) |
updated_at | date | yes | Landlord updated date (W3C format) |
Additional fields available with the expand headers:
Name | Type | Read-only | Comment |
---|---|---|---|
user | User | no | Full object |
notes | Note | no | Full object |
documents | Document[] | no | Full object |
properties | Property[] | no | array of Full object |
- JSON response example:
{
"landlord": {
"id": 35436,
"first_name": "Johnny",
"middle_name": "Johnny",
"last_name": "Trump",
"email": "johnny.t@gmail.om",
"mobile": "0478524147",
"address": "Dubai Marina",
"documents": {
"id": 1,
...
},
...
"birth_date": "1979-02-12T22:55:29Z",
"created_at": "2009-07-20T22:55:29Z",
"updated_at": "2011-05-05T10:38:52Z",
}
}
Get Landlord
- Endpoint:
GET /landlords
- Allowed for:
users that has right landlord.read
- JSON response:
This endpoint will return a list of Landlord.
- JSON response example:
{
"landlords": [
{
"id": 223443,
"first_name": "Johnny",
...
},
{
"id": 8678530,
"first_name": "James",
...
}
]
}
Create Landlord
- Endpoint:
POST /landlords
- Allowed for:
users that has right landlord.update
- JSON request data
Name | Type | Mandatory | Comment |
---|---|---|---|
title | string | no | Title of the agent (Mrs, Miss, Mr) |
first_name | string | yes | Landlord first name |
middle_name | string | no | Landlord middle name |
last_name | string | yes | Landlord last name |
string | yes | Client email | |
mobile | string | yes | The landlords mobile phone |
address | string | no | The landlords address |
pobox | string | no | The landlord's pobox / postalcode |
city | string | no | The landlord's city |
passport | string | no | The landlords passport ID |
passport_expired_at | date | no | Expiration date of the passport |
user | User | no | User attached to the given landlord - permission landlord.update.other required |
birth_date | date | no | Landlord's birth date (W3C format) |
nationality | string | no | Landlord's nationality (W3F format: 3Letters) |
country | string | no | Landlord's country (W3F format: 3Letters) |
notes | Note[] | no | Landlord's notes |
documents | Document[] | no | Landlord's documents |
identity_number | alphanumeric | no | The landlord's ID number |
legal_representative | Legal_Representative[] | no | Landlord's Legal representative |
family_information | Family_Information[] | no | Landlord's Family Information |
second_buyer | Second_Buyer[] | no | Landlord's Second Buyer |
fields | array | optional | custom field list |
Legal_Representative[] (optional)
Name | Type | Mandatory | Comment |
---|---|---|---|
first_name | string | no | first name |
last_name | string | no | last name |
Second_Buyer[] (optional)
Name | Type | Mandatory | Comment |
---|---|---|---|
spouse_name | string | no | spouse name |
children | integer | no | number of children |
marital_status | string | no | married, single |
# Family_Information[] (optional)
Name | Type | Mandatory | Comment |
---|---|---|---|
first_name | string | no | first name |
last_name | string | no | last name |
string | no | ||
mobile | string | no | mobile phone |
relation | string | no | spouse, companion, husband, friend, parent, sibling, child, relative, business_partner, stakeholders, investor, other |
- JSON request example:
{
"landlord": {
"first_name": "Johnny",
"identity_number": "123-1985-2608971",
"legal_representative": {
"first_name": "Shireen",
"last_name": "Shahid"
},
"family_information": {
"spouse_name": "John McGrover",
"children": 7,
"marital_status": "married"
},
"second_buyer": {
"first_name": "Mina",
"last_name": "Siyahi",
"email": null,
"phone": null,
"mobile": "+971507890564",
"relation": "sibling"
},
"fields": {
"1": "2 pets", // id of the field => value of the field
"3": true
}
...
},
}
- JSON response:
This endpoint will return a Landlord.
Update Landlord
- Endpoint:
PUT /landlords
- Allowed for:
landlords that has right landlord.update
- JSON request data
The mandatory fields are similar than landlord creation.
- JSON request example:
{
"landlord": {
"first_name": "Johnny",
...
},
}
- JSON response:
This endpoint will return a Landlord.
Delete Landlord
- Endpoint:
DELETE /landlords/{id}
- Allowed for:
users that has right landlord.update
- JSON response:
This endpoint will return a 204 http code if success.
Document Management
You can manage your documents directly in landlord POST/PUT action with a document list.
Data for a new document :
Name | Type | Mandatory | Comment |
---|---|---|---|
token | string | yes | Upload token |
title | string | yes | Document's title |
Data for a existing document :
Name | Type | Mandatory | Comment |
---|---|---|---|
id | integer | yes | Document's id |
title | string | yes | Document's title |
- JSON request example :
{
"landlord": {
...
"documents": [
{
"document": {
"token": "existing-token",
"title": "The title of the document"
}
},
{
"document": {
"id": "6",
"title": "The title of the existing document"
}
}
]
}
}
existing-token
is the token retrieved when the corresponding file was uploaded.
6
is an id of already uploaded and attached document to the landlord.
- JSON response example (With expand):
...
"documents": [
{
"id": 6,
"landlord": {
"id": 3
},
"user": {
"id": 1,
"first_name": "Jon",
"last_name": "D",
"email": "admin@admin.com",
"licence": "XDXDSEF4",
"mobile": "040404044",
"landline": null,
"landline_extension": null,
"photo": null,
"role": "admin",
"theme": null,
"lang": null,
"created_at": "2013-01-04T00:00:00+04:00",
"updated_at": "2013-01-04T00:00:00+04:00"
},
"title": "The title of the existing document",
"file": {
"id": 8,
"link": "https://s3-ap-southeast-1.amazonaws.com/foo/bar",
"created_at": "2015-11-19T09:46:14+04:00"
},
"created_at": "2015-11-19T09:46:14+04:00",
"updated_at": "2015-11-19T09:46:14+04:00"
},
{
"id": 7,
"landlord": {
"id": 3
},
"user": {
"id": 1,
"first_name": "Jon",
"last_name": "D",
"email": "admin@admin.com",
"licence": "XDXDSEF4",
"mobile": "040404044",
"landline": null,
"landline_extension": null,
"photo": null,
"role": "admin",
"theme": null,
"lang": null,
"created_at": "2013-01-04T00:00:00+04:00",
"updated_at": "2013-01-04T00:00:00+04:00"
},
"title": "The title of the document",
"file": {
"id": 8,
"link": "https://s3-ap-southeast-1.amazonaws.com/foo/bar.doc",
"created_at": "2015-11-19T09:46:14+04:00"
},
"created_at": "2015-11-19T09:46:14+04:00",
"updated_at": "2015-11-19T09:46:14+04:00"
}
],
Bulk Actions
PATCH /landlords
- Allowed for:
users that has right landlord.update (state action) users that has right landlord.update, user.update (assignment action)
- JSON request:
Some actions are available:
Assign a landlord to an agent:
Name | Type | Mandatory | Comment |
---|---|---|---|
op | string | yes | Operation to execute (replace ) |
path | string | yes | Path "/id/assignment/user" to update the assignment. id must be an integer or the wildcard * |
value | integer | yes | Agent ID |
- JSON request example with mixed operations:
{
"operations": [
{ "op": "replace", "path": "/1/assignment/user", "value": "2" }
]
}
- JSON response:
Will return a 204 http code.
Bulk Deletes
DELETE /landlords
- Allowed for:
users that has right landlord.update
- JSON request:
An array of property ID. If you don't pass any ID, it will delete all landlords.
- JSON request example:
{
"landlords": [
1, 2, 3
]
}
- JSON response:
Will return a 204 http code.