How To Receive SMS Messages Without Responding

TwiliobabyWhen you purchase a new phone number with Twilio, the URL for voice and SMS is not configured so until you set this up you won’t be able to receive any incoming messages or calls. But what if you want to receive inbound text messages without sending anything back?

This morning I got a call on the Twilio support line from someone looking to receive inbound SMS messages to his Twilio numbers, without sending any responses back.  To keep things as simple as possible, he just wanted to collect the information sent in via the call logs, and not deal with any complex hosting of his Twilio application.  I realized this is something many customers look to do each day, so I’ve written up a step-by-step guide on how to configure your application and hosting with Twilio and Dropbox in just 5 minutes.

 

Creating Your Twilio Application

First, create your “application”, which in this case is really just going to be a blank XML file formatted so Twilio will understand it.  We’ll call ours sms.xml (make sure you save your file with the “.xml” file extension).  You can write this using any text editor.

sms.xml

<Response>

</Response>

Yep that’s right, just two lines of XML is all you need.  This will let Twilio know that it is a legitimate application, but also instruct Twilio not to send any response.

Sending a Simple Response Message

If you want to send a simple response to each person who messages your Twilio number instead, try this:

sms-response.xml

<Response>

<Sms>Thanks for your message!</Sms>

</Response>

Dropbox

 

 

 

 

 

Hosting Static Files with Dropbox

Dropbox is a simple and free solution for hosting static files without having to set up a servier, and in this case we’re going to save a simple XML file using TwiML, or Twilio Markup Language.  To get started, create a free Dropbox account.

Dropbox-publicOnce you’re account has been created and you’re logged into Dropbox, we need to upload the application that you created so that we can get a URL for the file and configure your Twilio number for SMS.  From within your Dropbox account, select the folder called Public.  This is where we will host your application.

SmsxmlSelect the “Upload” button and upload the file from your computer.  Once the file is uploaded, it will show up in the Dropbox web UI as one of the files within the Public folder.  Now we need to get the URL for this file so that we can configure your Twilio number.

To get this URL, click on your file in the list and copy the URL from your browser, it should be something like this: https://dl.dropbox.com/u/1234567/sms.xml

Configuring Your Twilio Number for SMS

Now we have a URL for our SMS application, so all we need to do it visit our Twilio.com account and tell Twilio where what to do whenever a text message is received.  

 

Log into your Twilio account and navigate to the Phone Numbers page, and select “edit” next to the number you wish to update.

 

 

 

 

Numconfig

 

 

 

You will see the options to configure voice and SMS applications, so check the box indicating your want to use this number for SMS and paste the URL of your application into the box:

 

 

Edit-your-number

 

 

Photo credit: Dougvr6 on Flickr

  • http://profile.typepad.com/abrah abraham

    Private Gists should work as well. http://gist.github.com/

  • http://profile.typepad.com/abrah abraham

    Private Gists should work as well. http://gist.github.com/

  • http://profile.typepad.com/poseurtech Abraham Williams

    Private Gists should work as well. http://gist.github.com/

  • http://profile.typepad.com/poseurtech Abraham Williams

    Private Gists should work as well. http://gist.github.com/

  • http://dxjones.com David Jones

    The simplest SMS.XML should be a single line:

  • http://dxjones.com David Jones

    The simplest SMS.XML should be a single line:

  • http://dxjones.com David Jones

    [Response/]

  • http://dxjones.com David Jones

    [Response/]

  • Simona Leblanc

    EPIC! THANKS that’s what i’ve been searching for hours!!!

  • Simona Leblanc

    EPIC! THANKS that’s what i’ve been searching for hours!!!

  • Fuelcell

    so how do you retrieve the messages

  • Fuelcell

    so how do you retrieve the messages

  • OmarGuzman

    How can we get this to work for MMS?

    • http://www.twilio.com Twilio

      Hey Omar, Right now MMS is only available for Canadian numbers and short-codes. We will update you as soon as you can use MMS in a US number. You can learn more + sign up for beta here: https://www.twilio.com/mms

  • Masood

    Done with all the steps now how can i view the Received Sms.Please help

    • http://www.twilio.com Twilio

      Hey Massood. You should receive an SMS right away. You can use a new hosting service called TwiMLbin.com to host your code now, and you can watch a SMS walkthrough here: http://bit.ly/1iQb4vm Let us know if you if you have an additional questions or need help.

  • casro

    Done All the Steps
    But I’m no sure if that Method still works.
    I have sent a message to my Twilio number but was unable to view it in my Message Log. Please provide me with a solution.

    • http://www.twilio.com Twilio

      Hey Casro,
      We’ve updated our method and hosting services.
      There’s new hosting service you can use called TwiMLbin.com to host your code now, and you can watch a SMS walkthrough here: http://bit.ly/1iQb4vm

      • casro

        Hey!
        The walkthrough on the video makes it even harder for me, the video seems not updated. The code is a bit different. Is there anyway you could set it up for me?

        • jonmarkgo

          Hey Casro,

          Sorry for the confusion! If you’re trying to receive a message without replying this method should still work. If you’d like to reply I recommend checking out our very up-to-date quickstart tutorials at https://www.twilio.com/docs/quickstart