3 Serverless Apps You Can Build With Nothing But TwiML
Time to read: 2 minutes
Close your TextEditor. We’re not git pushing anything to Heroku this time. You can build a few handy Twilio apps with nothing but TwiML Bins and a few lines of XML.
TwiML Bins allow you to write and host code from your account portal. This means you don’t have to worry about that localtunnel going offline when you close your laptop, or pushing new code to a server. All you need to build these apps is Twilio account. We’ll handle the rest.
Things You’ll Need
- A Twilio Account (sign up here)
- One Twilio number for each hack you want to build
What We’re Building
- An SMS Forwarding App
- A Conference Line
- A Rick Roll App
It’s go time.
Let’s say you are picking up a couch on Craigslist and maybe don’t want all of the internet to have your personal number. You can set up SMS forwarding using 4 lines of code.
Head into your Console, and select “Developer Center” This is where we’ll be doing the bulk of our work. Click “TwiML Bins” and drop the following code in the TwiML Bin.
Look for the “Valid TwimL” icon at the bottom of the TwiML bin. When you see that green check mark, that means you’re good to go. Give your TwiML Bin a friendly name like “SMS Forwarding”, and click save. Head back to your phone numbers page by clicking the “#” icon. Select the phone number you bought, and head to the “A Message Comes In” field under “Messaging”.
Select TwiML then choose your “SMS Forwarding” TwiML bin in the field to the right. Hit save and try out your hack brand new SMS forwarding app.
Here’s what selecting your TwiML Bin looks like:
One down. Two to go.
You don’t need to download that app or enter in a mile long PIN code. You can build your own conference line. This is all the code you need:
After you’ve entered this code into a TwiML bin, name it, and save it just like before. Head to the phone numbers page and click on the number you want to use for your conference line. Under the “Voice” field, click the drop down menu next to “A Call Comes In” and choose “TwiML”. Then scroll to the right and select your Conference Line TwiML Bin and hit save.
Next, grab some friends and start a party on your conference line.
This one is for the telemarketers, or friends you’re trying troll. Next time you have to give out a number, but don’t really want to, give out your RickRoll number. Fire up a TwiML bin and name it “Rick Roll” then drop this code in.
You can go through the same steps as you did previously to assign this TwiML bin to your RickRoll number. Head to your phone numbers page and click through to your Rick roll number. Select “TwiML” From the drop down menu of “when a call comes in” and choose your Rick Roll TwiML bin.
You now have three apps that are ready to rock!
If you have any more TwiML Bin ideas or want to dive deeper into hacking with Twilio, shoot me a note at kyleky@twilio.com.
Related Posts
Related Resources
Twilio Docs
From APIs to SDKs to sample apps
API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.
Resource Center
The latest ebooks, industry reports, and webinars
Learn from customer engagement experts to improve your own communication.
Ahoy
Twilio's developer community hub
Best practices, code samples, and inspiration to build communications and digital engagement experiences.