Accessing XML
Accessing XML using PHP:
To access the API include this function to your code:
//Get data from specific API//$base_url = URL of API//$accesskey = accesskey for the API//$privatekey = privatekey for the APIfunction getdata($base_url, $accesskey, $privatekey){$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $base_url);curl_setopt($ch, CURLOPT_USERPWD, $accesskey . ':'.$privatekey);curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);$data = curl_exec($ch);curl_close($ch);echo $data;}
How to use:
-Call the function getdata by passing API url, accesskey and private key
Example:
getdata("http://api.agentaccount.com/api/properties?office_id=15/","d5d69029db49466fa213dd6e04af284906161456", "24d80380e213c8eec87c662996d02c74da0bbf81");