Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free
  • By Greg Baugues
    How to Receive an SMS in Node.js with Twilio and HyperDev receive-sms-featured-image

    When someone texts your Twilio phone number, Twilio makes an HTTP request to your app. Details about the inbound message, such as what it said and the number it was sent from, are passed in the parameters of that request.

    In this post we’ll look at how to receive and parse that request in JavaScript using Node.js and Express. Then we’ll look at how to reply to the inbound SMS with a message of your own.

    sms-http-request-cycle

    Setup your Node.js Server

    For those who like to skip to the punchline, here’s all the JavaScript you’ll need:

    var express = require('express');
    var bodyParser = require('body-parser');
    var app = express();
    app.use(bodyParser.urlencoded({extended: false}));
    
    app.post("/message", function (request, response) {
      console.log(request.body); 
      response. …
    Read More
  • By Greg Baugues
    How I Taught My Dog to Text Selfies with an Arduino and Twilio dog-button

    When Twilio launched Programmable MMS, I started to wonder if we could teach our dog to text us selfies. Thanks to the Arduino Yun and a whole bunch of treats, the answer is a resounding “Yes!”, as you can see in this amazing video from Keith Hopkin over at Mashable:

    My dog texts me a selfie

    What you see in the video is a cigar box (your local cigar shop probably sells empties for $2) housing a “massive arcade button” and an Arduino Yun. The webcam is plugged into the USB port of the Yun, and a micro-USB cable runs out to a power source.

    cigar-box-exterior

    cigar-box-interior

    The WiFi enabled Arduino Yun has two microprocessors: one does all the pin interaction you typically associate with an Arduino. The second runs a stripped down version of Linux called OpenWRT which can run programs in your favorite scripting language (Python comes pre-installed, but you could put Ruby or Node …

    Read More
  • By Greg Baugues
    Send SMS with PHP and Twilio PHP and sending SMS with Twilio

    It takes just a few lines of code and even fewer minutes to send your first text message with PHP and Twilio. Here’s how:

     

    Sign up for a free Twilio account and buy a phone number.

    Install the PHP helper library with Composer: composer require twilio/sdk:5.* then put   require "vendor/autoload.php'; at the top of your file.

    Find your account SID and auth token in your console dashboard, and your phone number in your phone numbers list.

    Create a file called send-sms.php  and paste in the code below to:

    1. Include the helper library
    2. Create a Twilio client using our account credentials
    3. Create a new message from our Twilio number, to our cellphone

    <?php
    
    require_once "vendor/autoload.php"; 
    use Twilio\Rest\Client;
    
    $account_sid = "YOUR_TWILIO_ACCOUNT_SID";
    $auth_token = "YOUR_TWILIO_AUTH_TOKEN";
    $twilio_phone_number = "YOUR_TWILIO_PHONE_NUMBER";
    
    $client …
    Read More
  • By Greg Baugues
    Set Up a Temporary Phone Number in 3 Minutes with Twilio rubbish bin

    If you’ve ever sold anything on Craigslist, requested a quote on the internet, or watched The Wire, then you may have found yourself wishing for a “burner” phone. In this post we’ll use TwiML Bins to create a temporary phone number that forwards phone calls to your cellphone. This will take less than three minutes, even if you’ve never written a line of code before!

    Sign up for a free Twilio account if you don’t already have one. Then go to Developer Tools in your console and click on TwiML Bins. TwiML is a simple set of instructions used to program your Twilio number. TwiML Bins let you host static TwiML without setting up a server of your own.

    Create a TwiML Bin. Name it “Forward to my cellphone.” Then copy this code to your cellphone number when a call comes in.

    <Response>
      <Dial>312XXXXXXX …
    Read More
  • By Greg Baugues
    How to Text with Hodor hodor-call-center

    Hodor is not man of many words. In fact, he’s just got one: “Hodor.” And while communication may not be his forte, one wonders how his adventures with Brandon Stark might have turned out if they had the mobile communication technology we all take for granted today.

    Thanks to the recent release of TwiML Bins we don’t have to wonder any longer. To get in contact with Hodor, you need only call or text our Hodor Hotline at (917) 722-6264. Ask him anything you like, and digest the wisdom of his reply.

    text-hodor

    Even if you’ve never written a line of code before, you can build a hotline like this yourself in just five minutes with TwiML Bins. It’s easier than falling out the moon door. You’ll need to sign up for a free Twilio account to get started. Then there’s just three steps: 

    1. Write the three lines …
    Read More
  • By Greg Baugues
    Twilio Radio – The Podcast by Twilio red-radio

    Twilio Radio is a podcast featuring interviews from a few of the 100 speakers presenting at SIGNAL, our developer conference for communications. You can find Twilio Radio in iTunes and other podcast directories or you can listen to the interviews below. And if you’d like to join us at SIGNAL, use the promocode RADIO for 20% off when you register.

    Where do text messages come from?

    Ben Stein, who runs the messaging team at Twilio, talks about:

    • Why SMS is such an effective communication medium for businesses
    • SMS open and response rates
    • The SMPP (SMS) protocol
    • Technical differences between SMS and MMS
    • Best practices for scaling a Twilio messaging app

    What developers should know about job searching and negotiation

    Patrick McKenzie, co-founder of StarFighters, talks about:

    • What’s broken about with the recruiting and interviewing process?
    • How should a developer start their job search?
    • How should a developer answer the …
    Read More
  • By Greg Baugues
    How to Receive and Reply to an SMS in Rails with Twilio twilio_on_rails2

    Many thanks to James Jelinek (@shakycode) for this guest post on how to receive and reply to text messages with Rails.


    I’ve been working with Rails (and Twilio) for several years now and I love it. Twilio makes SMS, MMS, and Voice so easy to use. Even with the ease of use there is still somewhat of a learning curve as it pertains to integrating Twilio into your Ruby on Rails app. Today we’re going to cover a simple integration of Twilio into a new Ruby on Rails application that handles inbound and outbound messages. The first thing we need to do is to create a new Rails app.

    rails new sms
    

    This will generate our app simply called, “SMS”. Now we need to generate a basic controller to act as our endpoint for Twilio’s inbound requests.

    rails g controller messages reply
    

    When we create the controller we …

    Read More
  • By Greg Baugues
    Where Do Text Messages Come From? StorkSMS.png.001

    “…and when you click “SEND”, the API Stork scoops up your text message in its beak and flies a great distance to drop the message off to your recipient.”

    That doesn’t seem accurate. To get to the bottom of where texts come from we talked to Ben Stein, who is the man leading the messaging team here at Twilio. He sorted out the stork debate.

     
    Listen to our interview with Ben Stein below
    or find the Twilio Radio podcast on iTunes.


     

    Why are you such a fan of SMS?

    There’s so many things that point to SMS as not being a great way to communicate, but it turned out to be the most popular form of communication on the planet. It’s the only app that’s installed on every single phone ever. Email is not installed on every phone, but SMS is.

    And there’s something about short messaging and the ability …

    Read More
  • By Greg Baugues
    3 SIGNAL Speakers to Get You Started with the Internet of Things SIGNALConf2016

    Tired of watching your Arduino collect dust on your desk? We’ve got three rad speakers queued up at SIGNAL to get you started with hardware hacking and the Internet of Things.

    Katy Moe Live Codes her Hand

    Katy Moe is a cyborg. Literally. She implanted an NFC transponder in her hand that runs JavaScript. Her talk at SIGNAL is about the opportunities and pitfalls of open hardware for the human body. She’ll introduce us to NFC protocols by live-coding on stage and deploying an app to her hand.

    Kristin Salomon talks Hardware Hacking for Software People

    If want to get started in hardware hacking but have no experience with electronics and soldering, this session is for you. littleBits are electronic building blocks that snap together magnetically and can connect to the Internet via WiFi. Kristin Salomon is an Electronics Engineer at littleBits and gave such a great talk at SIGNAL …

    Read More
  • By Greg Baugues
    Sara Chipps on Teaching Girls to Code with Wearables Sara Chipps-4

    Sara Chipps has spent the better part of a decade teaching women to code. Her latest startup, JewelBots, makes programmable friendship bracelets for young girls get get them excited about engineering before their social circles tell them its uncool. She down with us on Twilio Radio to talk about user testing with middle school girls, why the hardware hacking world seems to be more diverse than the programming world, and how men can appropriately get involved with helping women and girls learn to code.

    Below is a partial transcript of our conversation with Sara. It’s been edited for the sake of narrative, which is to say that she said all these things but not necessary in this order. You can listen to the podcast for the full interview.

    Sara’s one of the 100 speakers speaking at SIGNAL, our developer conference for communications. If you’d like to meet Sara …

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.