Agencies/leads
Available methods
HTTP method | Path | Function |
---|---|---|
get | /agencies/{agency_id}/leads | Retrieve the leads list |
post | /agencies/{agency_id}/leads | Create a new lead |
get Retrieve the leads list /agencies/{agency_id}/leads
Path parameters
- agency_id The unique id for the real estate agency
Request body parameters
- limit The number of records to return (max: 10000, default: 10000)
- offset The number of records to skip (default: 0)
- timestamp Return records created or updated since this UNIX/POSIX timestamp
Response body
- total_items The total number of item regardless of pagination
- timestamp UNIX/POSIX timestamp of the most recent item inside this list
-
leads Array
- id Unique ID
- parent Parent ID (for skip some duplicate leads)
- provider Unique ID of the provider
- type Type of lead
- step Step of the lead
- date Date of contact
- reference The reference sent by the provider
- lastname Lastname of the contact
- firstname Firstname of the contact
- email e-mail address
- phone Phone number
- fax Fax number
- mobile Mobile phone number
- language Language code ISO 639-1 of the customer
- property Linked property ID
- contact Linked contact ID
- request Linked request ID
- user Linked user ID
- opened Opened date
- assigned Assigned to user date
- closed Closed by user date
- message Free text message
- criteria Search criteria
- created_at Date/time of the first creation
- updated_at Date/time of the last update
Example request
curl --request GET \
--url 'https://api.apimo.pro/agencies/{agency_id}/leads' \
--user 'provider:token'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.apimo.pro/agencies/{agency_id}/leads');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, 'provider:token');
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
curl_close($ch);
$values = json_decode($output, true);
?>
Example response
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 05 Dec 2024 10:31:56 +0100
Content-Type: application/json; charset=utf-8
Content-Length: 137
Connection: keep-alive
Vary: Accept-Encoding
{"leads":[{"id":170384,"parent":null,"provider":9999,"type":"1","step":"1","date":"2016-01-10 15:49:00","reference":"XYZ0001","lastname":"FRIN","firstname":"Marc","email":"frin.mac@myemail.com","phone":"+1-555-9090909","fax":"","mobile":"","contact":"4942871","request":null,"created_at":"2016-03-10 15:49:50","updated_at":"2016-04-25 16:31:52"}],"total_items":63,"timestamp":1461594712}
post Create a new lead /agencies/{agency_id}/leads
Path parameters
- agency_id The unique id for the real estate agency
Request body parameters
- reference Your own unique reference (required)
- date Date time of your request (Mysql Format: Y-m-d H:i:s)
- step Step of the lead (default: 1)
- type Type of the lead
- language Language code ISO 639-1 of the customer
- country Country code ISO 3166-1 alpha-2 of the customer
- title Title of the customer
- lastname Lastname of the customer
- firstname Firstname of the customer
- email e-mail address of the customer
- phone Phone number of the customer
- fax Fax number of the customer
- mobile Cellphone number of the customer
- address Postal address of the customer
- address_more More information about the postal address of the customer
- zipcode Postal code of the customer
- city City of the customer
- message Free text for the request
- recipient_lastname Lastname of the recipient (for send to a friend function)
- recipient_firstname Firstname of the recipient (for send to a friend function)
- recipient_email e-mail address of the recipient (for send to a friend function)
- area_min Minimum area criteria
- area_max Maximum area criteria
- area_unit ID of the area unit
- room_min Minimum rooms criteria
- room_max Maximum rooms criteria
- bedroom_min Minimum bedrooms criteria
- bedroom_max Maximum bedrooms criteria
- price_min Minimum price criteria
- price_max Maximum price criteria
- currency Currency ISO 4217 of the customer
- start_at Rental start at criteria (Mysql format)
- end_at Rental end at criteria (Mysql format)
- referral Origin of the action
- subreferral Sub-origin of the action
- property_reference Reference of the property
- property_address Address of the property
- property_address_more More information of the address of the property
- property_zipcode Postal code of the property
- property_city City of the property
- property_country Country of the property
- property_category Category of the property
- property_types Types of the property (separate with a comma)
- property_sybtype Subtype of the property
- property_view_landscape View of the property
- property_location location of the property
Response body
- None
Example request
curl --request POST \
--url 'https://api.apimo.pro/agencies/{agency_id}/leads' \
--user 'provider:token'
\
--header 'content-type: application/json' \
--data '{ "reference": "6751730c47857", "date": "2024-12-05 10:31:56", "step": "1", "type": "1", "language": "fr", "country": "FR", "title": "1", "lastname": "MARTIN", "firstname": "Jean", "email": "jean.martin@emailaddress.com", "phone": "+33106060600", "fax": "+33106060601", "mobile": "+33606060606", "address": "131 rue d Antibes", "address_more": "Second floor", "zipcode": "06400", "city": "Cannes", "message": "Hello, please can you call me back. Jean", "recipient_lastname": "DUPONT", "recipient_firstname": "Monique", "recipient_email": "monique.dupont@emailaddress.com", "area_min": "80", "area_max": "120", "area_unit": "1", "room_min": "1", "room_max": "4", "bedroom_min": "1", "bedroom_max": "3", "price_min": "400000", "price_max": "450000", "currency": "EUR", "start_at": "2016-08-01", "end_at": "2016-08-31", "referral": "1", "subreferral": "1234", "property_reference": "123456", "property_address": "80 boulevard de la Croisette", "property_address_more": "Immeuble Azur", "property_zipcode": "06400", "property_city": "Cannes", "property_country": "FR", "property_category": "1", "property_types": "1,2,3", "property_sybtype": "3", "property_view_landscape": "1", "property_location": "6" }' \
--include
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.apimo.pro/agencies/{agency_id}/leads');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, 'provider:token');
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POSTFIELDS, '{ "reference": "6751730c47857", "date": "2024-12-05 10:31:56", "step": "1", "type": "1", "language": "fr", "country": "FR", "title": "1", "lastname": "MARTIN", "firstname": "Jean", "email": "jean.martin@emailaddress.com", "phone": "+33106060600", "fax": "+33106060601", "mobile": "+33606060606", "address": "131 rue d Antibes", "address_more": "Second floor", "zipcode": "06400", "city": "Cannes", "message": "Hello, please can you call me back. Jean", "recipient_lastname": "DUPONT", "recipient_firstname": "Monique", "recipient_email": "monique.dupont@emailaddress.com", "area_min": "80", "area_max": "120", "area_unit": "1", "room_min": "1", "room_max": "4", "bedroom_min": "1", "bedroom_max": "3", "price_min": "400000", "price_max": "450000", "currency": "EUR", "start_at": "2016-08-01", "end_at": "2016-08-31", "referral": "1", "subreferral": "1234", "property_reference": "123456", "property_address": "80 boulevard de la Croisette", "property_address_more": "Immeuble Azur", "property_zipcode": "06400", "property_city": "Cannes", "property_country": "FR", "property_category": "1", "property_types": "1,2,3", "property_sybtype": "3", "property_view_landscape": "1", "property_location": "6" }');
$output = curl_exec($ch);
curl_close($ch);
$values = json_decode($output, true);
?>
Example response
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 05 Dec 2024 10:31:56 +0100
Content-Type: application/json; charset=utf-8
Content-Length: 137
Connection: keep-alive
Vary: Accept-Encoding
{"id":188699,"created_at":"2016-04-29 16:17:23","updated_at":"2016-04-29 16:17:23"}