Tropo is part of CiscoLearn More

Sending Text Messages

Sending a text message requires two parts with Tropo - first, you need to write the code telling Tropo what message to send. The second step is telling Tropo to run your code. However, in order to make outbound calls or send outbound SMS at all, you will also need to verify your account. Please contact support to begin the process.

You also need an SMS-enabled phone number attached to your application, otherwise there is no "transport" for the SMS to use for delivery. U.S. numbers can be used to reach U.S. destinations; the Canadian numbers should be used for elsewhere in the world.

Here's an example of a simple app that sends a basic reminder message:

call("+12125557777", {
   network:"SMS"});
say("Don't forget your meeting at 2 p.m. on Wednesday!");
call "+12125557777", {
   :network => "SMS"}
say "Don't forget your meeting at 2 p.m. on Wednesday!"
<?php
call("+12125557777", array(
   "network" => "SMS")
);
say ("Don't forget your meeting at 2 p.m. on Wednesday!");
?>
call("+12125557777", {
   "network":"SMS"})
say("Don't forget your meeting at 2 p.m. on Wednesday!")
call("+12125557777", [
   network: "SMS"])
say("Don't forget your meeting at 2 p.m. on Wednesday!")

To then launch the code, Tropo provides you with a URL to hit, which tells Tropo to launch your application. You also get a secret API key called a “token” that ensures only you can start your code (we recommend guarding the token like you would a password). Your API token is found just under the phone numbers when you view your application in the Tropo user interface.

To launch an application using your secret token, embed it directly into a URL like this:

https://api.tropo.com/1.0/sessions?action=create&token=:TOKEN

Then either run the link through a browser or utilize an HTTP client like cURL (the http client that comes with your favorite language is absolutely fine) and set it to use GET. You can also use a POST with JSON or XML if you'd prefer - this page outlines the syntax you would use.

Note, if you want to send (or receive) text messages, you will also need an SMS-enabled phone number assigned to your application. If texting outside the US, you'll find the most success when sending from one of Tropo's Canadian numbers. To add a phone number, first log in at the Tropo website, then go to "Your Applications" and expand your application so you can make changes to it. Near the bottom of the application you'll see an "Add a new phone number" link; click on it, select your area code and you're ready to go!

Note, by default there are restrictions on what destinations a text message can go to. Review our detailed documentation on dialing an SMS for more information.

When sending a text message, set the network parameter to "SMS".