iPhone & iPad API Extended

HTTP POST / GET facility

 

This API allows you to get the Access Key and Private Key from the zooproperty system by providing the username and password of a zooproperty account. Basically, this API can be used for ANY application which is required to request and read the Zoo Property database without knowing any zoo property key and can be combined with other zooproperty’s apis for authorization purpose.

1. For a developer user, you have to use sub domain in the url:

  • http://usersdomain.agentaccount.com/api_login

eg:

  • http://agentpoint.agentaccount.com/api_login?username=yourusername&password=yourpassword

2. For an agent user, you can use sub domain or not in the url:

  • http://agentaccount.com/api_login?username=yourusername&password=yourpassword

Output:

  1. <records type="array">
  2. <record>
  3. <data>
  4. <username>demouser</username>
  5. <password>123456</password>
  6. </data>
  7. <error-fields/>
  8. <error-message/>
  9. <success type="boolean">true</success>
  10. <keys>
  11. <private-key>7abc1bd6d3bfe7016d79f6ba6f3de81d798ef923</private-key>
  12. <access-key>5a948d2c983111cffdc80d247d3ba4fa0b2b0839</access-key>
  13. <office-id type="integer">1</office-id>
  14. <agent-id type="integer">1</agent-id>
  15. </keys>
  16. </record>
  17. </records>

Parameter Descriptions

Field Description
username Mandatory Field – VARCHAR(255)
password Mandatory Field – VARCHAR(255)

Accessing API

example in php code:

  1. //sending Post data to specific API
  2. <?php
  3. // get data from user
  4. if(isset($_POST['username'])) $ username = $_POST['username'];
  5. if(isset($_POST['password'])) $ password = $_POST['password'];
  6. // send to API
  7. $ch = curl_init();
  8. curl_setopt($ch, CURLOPT_URL, 'http://agentpoint.agentaccount.com/api_login');
  9. curl_setopt ($ch, CURLOPT_POST, 1);
  10. curl_setopt ($ch, CURLOPT_POSTFIELDS, "username=$username&password=$password");
  11. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  13. curl_exec($ch);
  14. curl_close($ch);
  15. ?>