Skip to content

Instantly share code, notes, and snippets.

@okal
Created January 4, 2011 14:20
Show Gist options
  • Save okal/764806 to your computer and use it in GitHub Desktop.
Save okal/764806 to your computer and use it in GitHub Desktop.
Using Tropo Scripting API from the server with PHP and Curl
<?php
$url = "http://api.tropo.com/1.0/sessions?action=create&token=YOUR_TOKEN_HERE";//You can pass more parameters just as shown in the Quickstart guide.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
$xmlResponse = curl_exec($ch);
curl_close ($ch);
echo $xmlResponse; //So you can see the results from your browser when you access this script
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment