"Twilio" (Service Connection)

Connect to Twilio using the Wolfram Language to send text messages and query data about your account and past activity.

Connecting & Authenticating

ServiceConnect["Twilio"] creates a connection to the Twilio API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.
This service requires a connection to the internet and a Twilio account.

Requests

ServiceExecute["Twilio","request",params] sends a request to the Twilio API, using parameters params. The following give possible requests.

Send SMS/MMS

Request:

"Send" send SMS or MMS for a given phone number

Parameters:
  • "From"(required)a registered Twilio phone number or alphanumeric sender ID
    "To"(required)destination phone number; requires "+" and country code (e.g. +12225551212)
    "Body"Nonemessage body (maximum 1600 characters)
    "MediaURL"NoneURL for media to send with message (supports .gif, .png, and .jpeg)
  • Message Status

    Request:

    "MessageStatus" information about a specific message

    Parameters:
  • "MessageSID"Noneunique 34-character Twilio message SID
  • List Messages

    Request:

    "ListMessages" list of messages sent from your account

    Parameters:
  • "From"Nonea registered Twilio phone number or alphanumeric sender ID
    "To"Nonedestination phone number; requires "+" and country code (e.g. +12225551212)
    "Date"Nonedate messages were sent
  • Examples

    Basic Examples  (4)

    Send SMS:

    In[1]:=
    Click for copyable input
    Out[1]=
    In[3]:=
    Click for copyable input
    Out[3]=

    Send MMS:

    In[1]:=
    Click for copyable input
    Out[1]=

    Message status:

    In[1]:=
    Click for copyable input
    Out[1]=

    List messages:

    In[1]:=
    Click for copyable input
    Out[1]=