Agencies/contacts
Available methods
HTTP method | Path | Function |
---|---|---|
get | /agencies/{agency_id}/contacts | Retrieve the contacts list |
post | /agencies/{agency_id}/contacts | Create a new contact |
put | /agencies/{agency_id}/contacts/{contact_id} | Update a contact |
get Retrieve the contacts list /agencies/{agency_id}/contacts
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
-
contacts Array
Example request
curl --request GET \
--url 'https://api.apimo.pro/agencies/{agency_id}/contacts' \
--user 'provider:token'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.apimo.pro/agencies/{agency_id}/contacts');
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);
?>
post Create a new contact /agencies/{agency_id}/contacts
Path parameters
- agency_id The unique id for the real estate agency
Request body parameters
- category Category of the contact (personal, professional …)
- user Unique ID of the user (required)
- password Password to give an access to the Extranet feature
- activity Main activity of the contact (for professionals only)
- title Personal title (mister, madam)
- firstname First name of the contact
- lastname Last name (required if company name not provided) (required)
- company Company name (required if lastname not provided) (required)
- vat_number VAT number of company
- spouse_title Spouse's personal title (mister, madam)
- spouse_firstname Spouse's first name
- spouse_lastname Spouse's last name
- birthday_at Birthday date (format YYYY-MM-DD)
- spouse_birthday_at Spouse's birthday date (format YYYY-MM-DD)
- email E-mail address
- spouse_email Spouse's e-mail address
- phone Phone number
- mobile Mobile number
- fax Fax number
- address Postal address
- address_more More details about postal address
- zipcode Zipcode/Postal code
- city Name of the city (can be a reference)
- country Country code ISO 3166-1 alpha-2
- nationality Country code ISO 3166-1 alpha-2
- spouse_nationality Country code ISO 3166-1 alpha-2
- taxcode Contact's taxcode
- spouse_taxcode Spouse's taxcode
- comment Comment
- relationship Contact's relationship
- civil_status Contact's civil status
- children Number of children
- website Website url
- mailing Subscription to a paper mailing
- emailing Subscription to an electronic mailing
- magazine Subscription to a magazine
- incoming_action_at Last incoming action
- outgoing_action_at Last outgoing action
- language Node of languages codes ISO 639-1
- tags_customized Array of customized tags (different for each agency)
Response body
- id Unique ID
- created_at Date/time of the first creation
- updated_at Date/time of the last update
Example request
curl --request POST \
--url 'https://api.apimo.pro/agencies/{agency_id}/contacts' \
--user 'provider:token'
\
--header 'content-type: application/json' \
--data '{ }' \
--include
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.apimo.pro/agencies/{agency_id}/contacts');
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, '{ }');
$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 11:47:37 +0100
Content-Type: application/json; charset=utf-8
Content-Length: 137
Connection: keep-alive
Vary: Accept-Encoding
{"id":"3021944"}
put Update a contact /agencies/{agency_id}/contacts/{contact_id}
Path parameters
- agency_id The unique id for the real estate agency
- contact_id The unique id for the contact to update
Request body parameters
- category Category of the contact (personal, professional …)
- user Unique ID of the user (required)
- password Password to give an access to the Extranet feature
- activity Main activity of the contact (for professionals only)
- title Personal title (mister, madam)
- firstname First name of the contact
- lastname Last name (required if company name not provided) (required)
- company Company name (required if lastname not provided) (required)
- spouse_title Spouse's personal title (mister, madam)
- spouse_firstname Spouse's first name
- spouse_lastname Spouse's last name
- birthday_at Birthday date (format YYYY-MM-DD)
- spouse_birthday_at Spouse's birthday date (format YYYY-MM-DD)
- email E-mail address
- spouse_email Spouse's e-mail address
- phone Phone number
- mobile Mobile number
- fax Fax number
- address Postal address
- address_more More details about postal address
- zipcode Zipcode/Postal code
- city Name of the city (can be a reference)
- country Country code ISO 3166-1 alpha-2
- nationality Country code ISO 3166-1 alpha-2
- spouse_nationality Country code ISO 3166-1 alpha-2
- mailing Subscription to a paper mailing
- emailing Subscription to an electronic mailing
- magazine Subscription to a magazine
- incoming_action_at Last incoming action
- outgoing_action_at Last outgoing action
- language Node of languages codes ISO 639-1
- tags_customized Array of customized tags (different for each agency)
Response body
- id Unique ID
- created_at Date/time of the first creation
- updated_at Date/time of the last update
Example request
curl --request PUT \
--url 'https://api.apimo.pro/agencies/{agency_id}/contacts/{contact_id}' \
--user 'provider:token'
\
--header 'content-type: application/json' \
--data '{ }' \
--include
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.apimo.pro/agencies/{agency_id}/contacts/{contact_id}');
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, '{ }');
$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 11:47:37 +0100
Content-Type: application/json; charset=utf-8
Content-Length: 137
Connection: keep-alive
Vary: Accept-Encoding
{"id":"3021944"}