| Tropo WebAPI Development Guide | Home | Frameset Home |
|

{"tropo":[
{
"call":{
"to":[
"tel:+14075551212"
]
}
},
{
"say":[
{
"value":"Remember, you have a meeting at 2 PM",
"voice":"kate"
}
]
}
]
}
http://api.tropo.com/1.0/sessions?action=create&token=TOKEN
{"session": {
"id": "76b05a0b25127dbf59a4627f6dcd38a7",
"accountId": "12345",
"timestamp": "2010-05-05T01:59:19.402Z",
"userType": "NONE",
"initialText": null,
"callId":"092f931c4dddf0124ef426c56d26f98c",
"parameters": {
"token": "TOKEN",
"action": "create",
"numberToDial": "14075551212",
"msg": "This is a message"
}
}
}
<?php // Turn off error reporting to prevent markup likeWarning: Trying to do this with that
from being sent with the JSON error_reporting(0); // Include the Tropo PHP WebAPI Library and Limonade framework require 'tropo-webapi-php/tropo.class.php'; require 'lib/limonade.php'; // Naming the resource so you can reference it in the URL you define in your application setup // like this: http://www.example.com/test_app?uri=start dispatch_post('/start', 'app_start'); function app_start() { // Pull in the session information and specific parameters you want to use $session = new Session(); $numberToDial = $session->getParameters("numberToDial"); $msg = $session->getParameters("msg"); // Create new instance of the Tropo object $tropo = new Tropo(); // Send the message using the value assigned to msg and numberToDial in the session API URL $tropo->message($msg, array('network' => 'SMS', 'to' => $numberToDial)); // Render the JSON for the Tropo WebAPI to consume. return $tropo->RenderJson(); } // Run the app! run(); ?>
POST - http://api.tropo.com/1.0/sessions |
| ANNOTATIONS: EXISTING POSTS |
| login |
|