Contacts & Enquiries via HTTP

This API allows you to submit contact information and enquiry details submitted by any user who fills in a web form on your website. Contacts along with their enquiry details can be viewed in the Contacts section of Zoo Property. If it was a property enquiry then the enquiry can also be viewed in the Notes section of that property. This API can be used to remit this information from any type application including Office Website, Mobile Phone Site, iPad Site, facebook Application and anything else.

HTTP Post facility

  • http://agentpoint.agentaccount.com/agents/1/offices/1/contact_listeners

Output:

  1. <records type="array">
  2. <record>
  3. <error-message/>
  4. <error-fields/>
  5. <success type="boolean">true</success>
  6. <data>
  7. <office-id>1</office-id>
  8. <agent-id>1</agent-id>
  9. <property-id>396</property-id>
  10. <title>mr</title>
  11. <first-name>foo</first-name>
  12. <last-name>bar</last-name>
  13. <email>foo@bar.com</email>
  14. <contact-number/>
  15. <fax-number/>
  16. <home-number/>
  17. <mobile-number/>
  18. <work-number/>
  19. <country/>
  20. <alert>1</alert>
  21. <alert-type/>
  22. <contract>1</contract>
  23. <note-type>2</note-type>
  24. <heard-from-id>8</heard-from-id>
  25. <heard-about-us>6</heard-from-id>
  26. <category-id>2</category-id>
  27. <address/>
  28. <note/>
  29. <listing-type/>
  30. <property-type/>
  31. <suburbs/>
  32. <min-bedroom/>
  33. <min-bathroom/>
  34. <min-carspace/>
  35. <max-price/>
  36. <min-price/>
  37. </data>
  38. </record>
  39. </records>

Output for multiple contact alerts:

  1. <records type="array">
  2. <record>
  3. <error-message/>
  4. <error-fields/>
  5. <success type="boolean">true</success>
  6. <data>
  7. <office-id>1</office-id>
  8. <agent-id>1</agent-id>
  9. <property-id>396</property-id>
  10. <title>mr</title>
  11. <first-name>foo</first-name>
  12. <last-name>bar</last-name>
  13. <email>foo@bar.com</email>
  14. <contact-number/>
  15. <fax-number/>
  16. <home-number/>
  17. <mobile-number/>
  18. <work-number/>
  19. <country/>
  20. <alert>1</alert>
  21. <alerts type="array">
  22. <alert>
  23. <listing-type/>
  24. <property-type/>
  25. <suburbs/>
  26. <min-bedroom/>
  27. <min-bathroom/>
  28. <min-carspace/>
  29. <max-price/>
  30. <min-price/>
  31. <suburbs/>
  32. </alert>
  33. <alert>
  34. <listing-type/>
  35. <property-type/>
  36. <suburbs/>
  37. <min-bedroom/>
  38. <min-bathroom/>
  39. <min-carspace/>
  40. <max-price/>
  41. <min-price/>
  42. <suburbs/>
  43. </alert>
  44. </alerts>
  45. <contract>1</contract>
  46. <note-type>2</note-type>
  47. <heard-from-id>8</heard-from-id>
  48. <heard-about-us>6</heard-from-id>
  49. <category-id>2</category-id>
  50. <address/>
  51. <note/>
  52. <suburbs/>
  53. </data>
  54. </record>
  55. </records>

Parameter Descriptions

Field Description
agent_id This corresponds to the ID of the agent.
office_id This corresponds to the ID of the office.
property_id This corresponds to the ID of the property.
title VARCHAR(255)
first_name Mandatory Field – VARCHAR(255)
last_name Mandatory Field – VARCHAR(255)
email VARCHAR(255)
home_number VARCHAR(255)
work_number VARCHAR(255)
mobile_number VARCHAR(255)
contact_number VARCHAR(255)
fax_number VARCHAR(255)
alert 1 or 0 – 1 specifies the contact sign up for alert. 0 specifies the  contact are not sign up for alert
contract 1 or 0 – 1 specifies the contact given contract/application. 0 specifies  the contact are not given contract/application
heard_from_id Integer(11)
The “type” of property the contact fills the form
heard_from_id = 7 →  Office Website
heard_from_id = 8 →  Individual Property Website
heard_from_id = 9 →  Individual Agent Website
heard_from_id = 10 →  Mobile Phone Website
heard_from_id = 11 →  Iphone Application
heard_from_id = 12 →  Facebook Application
heard_from_id = 13 →  Telephone
heard_from_id = 14 →  Internet (Source 1)
heard_from_id = 15 →  Internet (Source 2)
heard_from_id = 16 →  Internet (Source 3)
heard_from_id = 17 →  Print (Source 1)
heard_from_id = 18 →  Print (Source 2)
heard_from_id = 19 →  Print (Source 3)
heard_from_id = 20 →  Email Alert
heard_from_id = 21 →  SMS Alert
heard_from_id = 22 →  Signboard
heard_from_id = 23 →  Referral
country VARCHAR(255)
note_type Mandatory Field – Integer(11)
The “type” of note
note_type = 2 → Sales Appraisal
note_type = 3 → Rental Appraisal
note_type = 4 → Alert- Created
note_type = 5 → Open Inspection Attendee
note_type = 6 → Property Enquiry
note_type = 7 → Submit Offer
note_type = 8 → Purchase Property
note_type = 9 → Lease Property
note_type = 10 → Attend Auction
note_type = 11 → Testimonial
note_type = 12 → Contract Provided
note_type = 13 → General
note TEXT (the note or comment)
address VARCHAR (255) / address for the property
alert_type VARCHAR (255)
alert_type = “Newly Listed Properties”
alert_type = “Updated Properties”
alert_type = “Open Inspections”
alert_type = “Sold/Leased Properties”
alert_type = “Auctions”
alert_type = “Latest News”
listing_type VARCHAR (255)
listing_type = “BusinessSale”
listing_type = “Commercial”
listing_type = “ResidentialLease”
listing_type = “ResidentialSale”
listing_type = “HolidayLease”
listing_type = “ProjectSale”
property_type VARCHAR (255)
property type according to the listing type of that country
min_bedroom Integer(11)
min_bathroom Integer(11)
min_carspace Integer(11)
min_price Integer(11)
max_price Integer(11)
suburbs Muliple sub urb with “,” coma as separator
ex: suburb1,sub urb2,suburb3
heard_about_us Integer(11)
The “type” of  the contact fills the form
heard_about_us = 1 → Newspaper
heard_about_us = 2 → Referral
heard_about_us = 3 → Web
heard_about_us = 4 → Past Client
heard_about_us = 5 → Sign board
heard_about_us = 6 → Other
category_id Integer(11)
The “type” of  the contact fills the form
category_id = 1 → Vendor – Past
category_id = 2 → Vendor – Existing
category_id = 3 → Vendor – Potential
category_id = 4 → Landlord – Past
category_id = 5 → Landlord – Existing
category_id = 6 → Landlord – Potential
category_id = 7 → Buyer – Past
category_id = 8 → Buyer – Potential
category_id = 9 → Tenant – Past
category_id = 10 → Tenant – Existing
category_id = 11 → Tenant – Potential
category_id = 12 → Other
NB:
  • first_name and last_name must be defined.
  • heard_from_id must be defined according to the available ids
  • note_type must be defined according to the available ids
  • if alert are checked and alert type are not set that will use “Lastest News” as the alert type
  • Input parameter example for multiple alerts (there are 2 alerts in this example):
    "alerts"=>{
    "0"=>{"min_carspace"=>"1",
    "listing_type"=>"ResidentialSale",
    "property_type"=>"Studio",
    "max_price"=>"111",
    "min_bathroom"=>"1",
    "min_price"=>"111",
    "min_bedroom"=>"1",
    "suburbs"=>"",
    "alert_type"=>"Updated Properties"},

    "1"=>{"min_carspace"=>"2",
    "listing_type"=>"ResidentialLease",
    "property_type"=>"House",
    "max_price"=>"222",
    "min_bathroom"=>"2",
    "min_price"=>"222",
    "min_bedroom"=>"2",
    "suburbs"=>"",
    "alert_type"=>"Newly Listed Properties"}
    ]

  • If alerts array parameter detected, any alert data outside this array parameter will be ignored.
  • If there are 2 or more identical alerts detected, only one alert will be created from its kind (to prevent duplication).
  • Empty alert inside the alerts array will be deleted. Example of empty alert:
    {"min_carspace"=>"",
    "listing_type"=>"",
    "property_type"=>"",
    "max_price"=>"",
    "min_bathroom"=>"",
    "min_price"=>"",
    "min_bedroom"=>"",
    "alert_type"=>""}]
  • if note type set as “property enquiry”, property_id and heard_from_id have to be prepared.
    And it will create note and alert for that property automatically, so no need to fill note, address, alert_type, listing_type, property_type, min_bedroom, min_bathroom, min_carspace,  min_price, max_price and suburbs

Accessing API

All data remitted is protected by an Access and Private Key so you will need the api keys for each office. Thsi can be found in the API page for that office in your Developer’s System.

example php code:

  1. To access the API include this code in the page which receives data through the contact form and complete these parameters:
  2. Access Key: 5a948d2c983111cffdc80d247d3ba4fa0b2b0839
  3. Private Key: 7abc1bd6d3bfe7016d79f6ba6f3de81d798ef923
  4. //sending Post data to specific API
  5. <?php
  6. // get data from form contact
  7. if(isset($_POST['first_name'])) $ first_name = $_POST['first_name'];
  8. if(isset($_POST['last_name'])) $ last_name = $_POST['last_name'];
  9. if(isset($_POST['email'])) $email= $_POST['email']);
  10. $accesskey= "5a948d2c983111cffdc80d247d3ba4fa0b2b0839"
  11. $privatekey= "7abc1bd6d3bfe7016d79f6ba6f3de81d798ef923"
  12. // send to API
  13. $ch = curl_init();
  14. curl_setopt($ch, CURLOPT_URL, 'http://agentpoint.agentaccount.com/agents/1/offices/1/contact_listeners');
  15. curl_setopt ($ch, CURLOPT_POST, 1);
  16. curl_setopt ($ch, CURLOPT_POSTFIELDS, "first_name=$first_name&last_name=$last_name&email=$email");
  17. curl_setopt($ch, CURLOPT_USERPWD, $accesskey . ':'.$privatekey);
  18. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  19. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  20. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  21. curl_exec($ch);
  22. curl_close($ch);
  23. ?>

Comments are closed.