The following PHP example requires cURL in order to work correctly (http://php.net/manual/en/curl.installation.php). Please refer to the http://developers.listen360.com for information specific to each API method.
POST
//Create XML string to be passed to API
$xml_string = "........"//Use API key to construct URL
$url = 'https://aaaabbbbbccccccddddd99999@app.listen360.com/organizations.xml';
//Open cURL connection
$ch = curl_init();
//Set the URL and POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_string);
//Set additional curl options
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/xml'));
//Execute the API call
$result = curl_exec($ch);
//close cURL connection
curl_close($ch);
GET
//Use API key to construct URL where Organization ID = 4444 and Customer ID = 3333
$url = 'https://aaaabbbbbccccccddddd99999@app.listen360.com/4444/customers/3333.xml';//Open cURL connection
$ch = curl_init();//Set the URL and POST data
curl_setopt($ch, CURLOPT_URL, $url);
//Set additional curl options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/xml'));
//Execute the API call
$result = curl_exec($ch);
//close cURL connection
curl_close($ch);
Additional Questions? Please reach out to Listen360 Support via email at support@listen360.com
Comments
0 comments
Please sign in to leave a comment.