Creating Your First Application

Tropo provides an easy-to-learn, easy-to-implement scripting environment designed for creating a wide variety of communications applications. Your script runs on our servers, very similar to the way a web application runs on a web server. Instead of interacting with the user via a web browser, however, a Tropo application interacts with the user via voice (using a standard telephone or Voice Over IP/SIP) or text (SMS).

Developing applications using Tropo Scripting is very easy to learn. You can use JavaScript, Ruby, PHP, Python or Groovy to create scripts that call Tropo’s communication functions; there’s no new language to learn! You simply get familiar with the functions you need to interact with Tropo, and these functions are powerful. All of the low-level stuff is handled behind the scenes. It takes only 1 line of code to answer a phone call, play a message using our Text To Speech (TTS) engine and an audio file to the caller and then disconnect:

say("Guess what? http://www.phono.com/audio/troporocks.mp3");
say "Guess what? http://www.phono.com/audio/troporocks.mp3"
<?php   
say("Guess what? http://www.phono.com/audio/troporocks.mp3");
?>
say("Guess what? http://www.phono.com/audio/troporocks.mp3")
say("Guess what? http://www.phono.com/audio/troporocks.mp3")

Getting a script like this running is every bit as easy. You can either enter your script and store it free on our servers, or store it on your own server and give Tropo the URL to find it. Once you create your application, you assign it a phone number and that’s it! You dial the number - Tropo executes the script - you hear the message and the call gets transferred. Lets walk you through registering and creating an app that uses the previous script:

First, register for your free account at https://www.tropo.com/register - after entering in the content, the page will refresh with the message:

"Your account has been created. Please check your email to verify and activate your account."

At this point, check your email for a validation link - click that link (or copy/paste it into your address bar if the link doesn't work) and your account is now active.

Next, login to your new account using the Username and Password you defined during registration - the Login link is at the top right of any page of the Tropo website.

Once you're logged in, you'll want to create your test application:

1) Start by clicking on the "My Apps" link along the top, then select "Create application" in the dropdown.

2) Give the app a name, then select Tropo Scripting from the two options that follow.

3) Click the "New Script" link to the right of the empty field; this will launch the Script Editor.

4) Add in the sample code here, then at the very bottom give the file a name with the appropriate language extension (.rb for Ruby, .php for PHP, .py for Python, .js for JavaScript and .groovy for Groovy will all work); hit the Save button to save and continue with the app creation.

5) Next we'll add a phone number, to make it easy to call and test the app. Start by selecting your preferred country from the Country drop down, followed by the region in the Region drop down.

6) Click the Finish button at the bottom left of the screen to create the app.

7) That's it! Give the phone number a call to test it out!