How Teeboxer Uses Twilio to Power Its Service For Golfers

February 08, 2011
Written by
Rahim Sonawalla
Contributor
Opinions expressed by Twilio contributors are their own

Twilio Bug Logo

This is a guest post written by Yuri Gadow, founder of Teeboxer; a service created with the goal of combining many Internet technologies, including Twilio, to help golfers get out and play more and spend less time dealing with golf while off the course.

Yuri-gadow-rectangle
Twilio is the key to Teeboxer’s ability to work for golfers away from computers where a quick text or call can easily beat a mobile app for convenience. So when Twilio started their “Coordinating People Contest” I knew it was a perfect fit—Teeboxer’s first feature is a golf round planner that helps golfers coordinate tee times. When they announced Teeboxer had won I thought I ought to write a short post on how it uses Twilio to handle text messaging and interactive voice response.

Overview

Teeboxer and Twilio are both software-as-a-services, a fancy way of saying web application, using cloud computing for their infrastructure. Teeboxer runs in the Rackspace Cloud and Twilio in Amazon’s EC2. They communicate using a markup language called TwiML they exchange using web requests (the same way your browser gets HTML from websites.)

Calling

When a person calls Teeboxer, they’re actually calling Twilio which makes a web request to Teeboxer with some information about the call, e.g., the caller’s phone number. Teeboxer looks up the user by the phone number and uses TwiML to tell Twilio what to do next. For example, if Jane verifies her phone number with Teeboxer and then calls from it, Teeboxer will lookup her name, determine Jane’s local time, find information about her next round, and instruct Twilio to greet her using TwiML that looks like:

crayon-5b6d2497a7562129561678 inline="true" ]<Gather numDigits="1" action="https://teeboxer.com/example" method="POST"> <Say voice="woman" language="en" loop="1"> Good morning Jane

[/crayon]
This tells Twilio to “gather” one digit (via touch tone) from Jane’s phone at any time while it’s talking to Jane and to send that digit back to Teeboxer at teeboxer.com/twilio/example—using the same method your browser uses to send forms to websites, i.e., HTTP POST.

Texting

Just like calls to Teeboxer, when a person sends a text to Teeboxer it goes to Twilio which makes a web request to Teeboxer with the message and information about the sender. Teeboxer looks up the sender and looks through the text message for a command it can act upon.

Once Teeboxer figures out how to respond, it gives Twilio a bit of TwiML. For example, in response to Jane’s directions text, Teeboxer would lookup her next tee time and tell Twilio to text message Jane a link to a Google map for that course with a bit of TwiML:

crayon-5b6d2497a7568255346095 inline="true" ]<Response> <Sms>Map for Pebble Beach: http://j.mp/dKiZR6</Sms> </Response>

[/crayon]
That’s really all there is to it—the rest is just extrapolation and variation of these techniques.

You can follow Teeboxer’s technological side at twitter.com/teeboxerops