Created
January 4, 2011 14:20
-
-
Save okal/764806 to your computer and use it in GitHub Desktop.
Using Tropo Scripting API from the server with PHP and Curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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