#TWILIOCON Twilio Messaging - Overview and New Feature Deep Dive PATRICK MALATACK, DIRECTOR OF PRODUCT MANAGEMENT @ TWILIO GOWRI RAO, PRODUCT MANAGER, MESSAGING @ TWILIO
May 08, 2015
#TWILIOCON
Twilio Messaging - Overview and New Feature Deep Dive
PATRICK MALATACK, DIRECTOR OF PRODUCT MANAGEMENT @ TWILIO
GOWRI RAO, PRODUCT MANAGER, MESSAGING @ TWILIO
#TWILIOCON
Hi. I’m Gowri.I’m a Product Manager at Twilio.
#TWILIOCON
Hi. I’m Patrick.I’m a Product Manager at Twilio.
#TWILIOCON
By the end of this talk,
1. Why is SMS so important?
you’ll be able to answer these questions.
2. How do I send an SMS using Twilio?
3. What is Concatenated Messaging and how do I use it? (new)
4. What is Twilio Picture Messaging and how do I use it? (new)
#TWILIOCON
What is SMS & why does it matter? A brief review.Let’s take a quick look at the history of SMS and where we are today.
#TWILIOCON
What exactly is SMS?
Short Messaging Service (SMS) lets you send a message
(up to 160 characters) from a phone number you own
to any SMS enabled number in the world.
#TWILIOCON
Why should you care about SMS?
Twilio just lowered its
pricing to 3/4¢ per
message.
CHEAP
A lead contacted within
5 minutes is 100x more
likely to convert.
INSTANTTeenagers (18 - 24)
send 109.5 messages
per day on average.
POPULARTwilios APIs make it
super easy to integrate.
EASY
People send 41.5 SMS
messages per day on
average.
FAMILIAR
#TWILIOCON
of all humans use SMS85%
messages to communicate.
140 MillioniOS users
480 MillionAndroid users
2.4 BillionInternet Users
6 BillionSMS Subscribers
Android Image Credit: Jan Sebastian bach, from The Noun Project
#TWILIOCON
Current SMS offerings. The State of the Union.How can I use the existing Twilio services to send SMS updates?
#TWILIOCON
Sending SMS Messages: Phone Numbers
• Person-to-Person Messaging
• Self-service
• Local Experience
• Prohibited from High Volume
• Available in US, UK, & CA
#TWILIOCON
Sending SMS Messages: Short Codes
• Person-to-Person Messaging
• Self-service
• Local Experience
• Prohibited from High Volume
• Available in US, UK, & CA
#TWILIOCON
Where can I send to?
EVERYWHERE!1300+ CARRIERS200+ COUNTRIES
#TWILIOCON
How Stuff Works: Incoming Messages
!
GSM/CDMAHTTPRequest
#TWILIOCON
!
GSM/CDMAHTTPRequest
How Stuff Works: Outgoing Messages
#TWILIOCON
Sending a MessageExample:
POST https://api.twilio.com/2010-‐04-‐01/Accounts/AC123/SMS/Messages.json From='894546' To='16505766372' Body='Come check out our new fall fashions http://www.twiliofashions.com/'
#TWILIOCON
Brevity is overrated. Introducing Concatenated Messages.Let’s take a look at how Twilio helps you overcome the 160 character barrier.
#TWILIOCON
Previously: Break apart large messages
Each message was limited to 160 characters. Messages
larger than that had to be manually broken up into smaller
chunks.
#TWILIOCON
Today: Enter Message Concatenation
Twilio now supports messages up to 1,600 characters. No
more worrying about getting cut off mid sentence or
dealing with manual chunking.
#TWILIOCON
#1
#2
#3
#4
#3
#2
#4
#1
Message Concatenation: How does it work?
We use the new NumSegments property to keep track of the number of SMS
messages used to deliver your content.
#TWILIOCON
Seeing is believing. Introducing Twilio Picture Messages.Let’s take a look at how Twilio helps you send rich media using the Universal
Messaging API.
#TWILIOCON
What does Twilio Picture Messaging look like?Picture messaging (available on short codes) lets you display
media to directly to the user.
Before Now
#TWILIOCON
Twilio Picture Messaging: The Gritty Details
Currently available on US
Short Codes and to / from
US numbers.
USA ONLY
Pricing starts at 2¢ per
outbound message & 1¢ per
inbound message.
PRICING
You can attach a maximum
of 10 images per message.
UP TO 10 PHOTOS
#TWILIOCON
Twilio Picture Messaging: The Definitive Guide.
MEDIA
MESSAGES Similar to SMS, there is now a Message Resource. There
is also a corresponding <Message> TwiML verb which is
similar to <Sms>.
Messages now have a Media Sub-Resource which contains
any attached Pictures. There is also a corresponding
<Media> TwiML Noun for generating new Media Resources.
#TWILIOCON
Example #1: Sending a PictureLet’s take a look at how to use the Messages endpoint to send a Twilio Picture
Message.
Copyright © twilio Inc. 2013PRIVATE & CONFIDENTIAL
POST to /Messages List Resource
• From
• To
• Body - can now be up to 1600 characters long
• MediaURL - The URL(s) of the image(s) you want to send with your message. If you wish to send more than one image in your message, simply provide multiple MediaURLs
#TWILIOCON
Sending a Photo MessageExample:
POST https://api.twilio.com/2010-‐04-‐01/Accounts/AC123/SMS/Messages.json From='894546' To='16505766372' Body='New Dress in Stock' MediaUrl='http://images.com/dress.png'
Copyright © twilio Inc. 2013PRIVATE & CONFIDENTIAL
/Messages/{Sid} Resource
• From
• To
• Body - can now be up to 1600 characters long
• NumSegments
• NumMedia - The number of media associated with the message. For instance, if you sent a message with two images, this would be 2. If your message contained only text and no media this is 0
• /Media - Represents the set of media elements included with a given Message
#TWILIOCON
Example #2: Receiving a MessageLet’s use the Messages webhook to receive a picture message and take a
closer look at some of the new parameters that come along with it.
Copyright © twilio Inc. 2013PRIVATE & CONFIDENTIAL
/Messages WebhookBack
wards
Compatib
le
• From
• To
• Body - can now be up to 1600 characters long
• NumSegments
• NumMedia
• MediaURL {N} - URLs
• MediaContentType{N}
#TWILIOCON
New Param: MediaUrl#
Ex. MediaUrl0 → MediaUrlN
“MediaUrl0”: “https://api.twilio.com/2010-‐04-‐01/...",“MediaUrl1”: “https://api.twilio.com/2010-‐04-‐01/...",
Each media attachment gets its own MediaUrl# parameter pointing
to the image hosted on the Twilio CDN.
#TWILIOCON
New Param: MediaContentType#
Ex. MediaContentType0 → MediaContentTypeN
“MediaContentType0”: “image/png",“MediaContentType1”: “image/jpeg",
Each media attachment gets its own MediaContentType# parameter telling
you what kind of media it is (using the standard HTTP content types).
#TWILIOCON
Example #3: Replying to a message in TwiMLLet’s use TwiML to respond to the messages we receive with a Twilio Picture
Message.
#TWILIOCON
Example #3: Replying to a Message in TwiML
<?xml version="1.0" encoding="UTF-‐8"?><Response> <Message> <Body>I'm hungry!</Body> <Media>http://www.images.com/cheesesteak.png</Media> </Message></Response>
#TWILIOCON
Example #4: RESTfully Fetching MediaLet’s use the Twilio REST API to fetch the Media attachments for a message.
#TWILIOCON
GET https://api.twilio.com/2010-‐04-‐01/Accounts/AC123/Messages/MM1234/Media.json
Example #4: RESTfully Fetching MediaWe can issue a GET request to the Media sub-resource to get any Media objects.
QUESTIONS?