Property Page Views via HTTP

This API allows you to submit page views for properties back into the Zoo Property system. These page views can be seen in the “Notes” section for a property and can be broken down in relation to the source of the page view. eg Office Website, Mobile Phone Site, iPad Site, facebook Application etc.

HTTP Get facility

1) For adding a viewer to zoo agents

Output:

  1. <records type="array">
  2. <record>
  3. <success type="boolean">true</success>
  4. <total type="integer">1</total>
  5. <errors/>
  6. </record>
  7. </records>

Parameter Descriptions

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.
type_id Mandatory Field – integer(11)
The “type” of property viewer access come from
type_id = 1 → Office Website
type_id = 2 → Individual Property Website
type_id = 3 → Individual Agent Website
type_id = 4 → Mobile Phone Website
type_id = 5 → Iphone Application
type_id = 6 → Facebook Application
ip_address VARCHAR(50)

NB:

  • agent_id, office_id, and property_id must be defined.
  • type_id must be defined according the type/device
2) To see the total views for a property

Output:

  1. <records type="array">
  2. <record>
  3. <total type="integer">2</total>
  4. <errors> </errors>
  5. <success type="boolean">true</success>
  6. </record>
  7. </records>

Accessing the API

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

example of php code:
  1. To access the API include this code in the page which receives data from the contact form and complete these parameters:
  2. Access Key: 5a948d2c983111cffdc80d247d3ba4fa0b2b0839
  3. Private Key: 7abc1bd6d3bfe7016d79f6ba6f3de81d798ef923
  4. //sending GET  data to specific API
  5. <?php
  6. $accesskey= “5a948d2c983111cffdc80d247d3ba4fa0b2b0839”
  7. $privatekey= “7abc1bd6d3bfe7016d79f6ba6f3de81d798ef923”
  8. // send to API
  9. $ch = curl_init();
  10. curl_setopt($ch, CURLOPT_URL, 'http://agentpoint.agentaccount.com/agents/1/offices/1/properties/18320/property_notes/set_viewer?type_id=2&ip_address=127.0.0.1');
  11. curl_setopt($ch, CURLOPT_USERPWD, $accesskey . ':'.$privatekey);
  12. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  13. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  14. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  15. curl_exec($ch);
  16. curl_close($ch);
  17. ?>