Using Query strings to pass data between WebAPI pages

JustinDupree -

When using the Tropo WebAPI, it can be helpful to place information from one request into your on event's URL, and then extract that information from the URL when processing that event.

Here's an example using the PHP WebAPI library to get the Tropo session ID and send it along in your continue event as a URL query string.

    Tropo tropo = new Tropo();

    TropoSession session = tropo.session(req);

    $sID = session.getId());

    $tropo->on(array("event" => "continue", "next" => "yourApp.php?uri=URI&sessionID=". $sID));
 
Then in yourApp.php you can extract the session ID as follows:
 
$sessionID = $_GET['sessionID'];

While this example is written in PHP, the idea applies to any language.

Have more questions? Submit a request

0 Comments

Article is closed for comments.