DC Python


An Introduction to Sending SMS Texts With Twilio


Matt Makai / @mattmakai

Talk Approach

  • Quick overview of SMS and Twilio
  • Tutorial
  • Apps & Ideas
  • Resources

Who Am I?



 {'name': 'Matt Makai',
  'occupation': 'Full stack developer',
  'specialties': ['Python',
                  {'Django': 'since 0.96'},
                  'prototypes',
                  'oh crap! moments',
                  'DjangoCon speaker',
                  'Twilio rookie'],
  'normal_location': 'Washington, DC', 
 }
                    

codingacrossamerica.com

March 9 - August 9

Coding & Writing

Meeting startups

Redesign

SMS and Twilio

SMS

  • Short Message Service
  • Standardized communications protocol
  • 160 7-bit or 140 8-bit characters
  • Both mobile and capable landline phones

Why care about SMS texts?

  • 3.5 billion active users
  • 80-90% mobile phone owners use text messaging
  • 193,000 SMS sent per second
  • Engage with feature and smart phones
  • Alert recipient to take immediate action

Source: Wikipedia image

Twilio

What's Twilio?

  • Telecommunications abstraction layer
  • Voice, SMS, MMS, 2-factor authentication
  • Developer-focused organization
  • Used by Airbnb, Uber, The Home Depot

Tutorial

Twilio

Dashboard

Manage Numbers

SMS Usage

Yea but UI's aren't cool.

You know what's cool?

Building stuff programmatically.

Integration Paths

  • First- or third-party binding
  • Libsaas
  • Requests

Libsaas

twilio/twilio-python

Documentation

Let's send an SMS message

Environment variables

  • TwilioRestClient looks for TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN
  • Otherwise pass them into TwilioRestClient at construction
  • But don't do that. Use environment variables.

More code

  • twilio-python Messages code
  • Picture messages (with URL)
  • Retrieving list of sent messages
  • Filtering sent messages list

Message class

Send MMS with URL

Retrieve sent messages

Filter sent messages

Apps & Ideas

Txt 2 React

TrackMaven

Social Code

Resources

Resources

?

Thank you!