I’ve been writing some bot code lately to send SMS to groups. I found the perfect API for this with Cisco’s Tropo Product.
The API is super simple to use. You can make API calls or just post to URL using CURL or Python’s urllib2 library.
The use of the service for DEV is Free, however if you need Production support and service you will want to move to Production for that. For my testing I just signed up for the free Dev service and started coding away.
To save you some time the solution for the service is something like this:
- Sign up for an account, choosing Dev or Prod -> https://www.tropo.com/
- Create an Application from their Portal
- Click to add some code to /var/www/sms.py for both script boxes. You can use the same script.
- At the bottom you need to attach a phone #. Typically this is the number closest to where you want to send SMS, however I noticed UK or EU based numbers could send more readily worldwide. For cost however, you may want to have your script set the CallerID of whatever numbers you pick based on the Country Code of the Recipients Phone. Go on and attach multiple numbers if you like.
- Write up a script to post to the API. You can grab your API token from the bottom of your Applications Page in Tropo.
Posting is as simple as constructing a URL to the service like this:
https://api.tropo.com/1.0/sessions?action=create&token=TOKEN&numberToDial=11005555555&customerName=Joe+Good&msg=Tesintg+this+thing+out
That’s about it. Pretty Simple! Kudos to Tropo and Cisco for an amazing product!
If you have any questions or need help sending some SMS with your own account, then reach out to me.