O'Reilly logo

Twilio Best Practices by Tim Rogers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering messaging APIs

We've now seen how easy it is to make phone calls and work with them. Similar concepts work in order to send SMS and MMS messages, so we'll look at those next.

Sending your first SMS

To send an SMS, make a POST request to https://api.twilio.com/2010-04-01/Accounts/<your account SID>/Messages.json with the following parameters:

Parameter

Explanation

From

The phone number to be used as the caller ID for this message (it must be one of your Twilio numbers or another one you own and have verified with Twilio)

To

The phone number to send the message to

Body

The text you'd like to send in the SMS

Note

As you might be aware, a single SMS can contain a maximum of 160 characters. If you include more than this in the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required