Skip to main content

Twilio Component

Send SMS messages through Twilio

Component key: twilio

Description#

Twilio is a platform that allows you to send SMS text messages. You can use the Twilio component to send messages to your end users or to your team.

Authorization Notes#

Twilio allows you to use basic auth (username/password) or an API key / secret key pair to authenticate against their API.

Information about getting started and creating an account with Twilio can be found on their developer documentation site.

Triggers#

Webhook#

Trigger for handling webhooks from Twilio | key: webhook

You can configure a Twilio webhook to send information to a Prismatic webhook URL upon sending a text message.

The webhook configuration takes place when adding/updating contact phone numbers.

Output Example Payload#

{  "payload": {    "headers": {      "accept": "*/*",      "Content-Type": "application/json; charset=UTF-8",      "User-Agent": "TwilioProxy/1.1",      "Host": "hooks.example.prismatic.io"    },    "body": {},    "rawBody": {      "data": { "type": "Buffer", "data": [69, 120, 97, 109, 112, 108, 101] }    },    "queryParameters": None,    "webhookUrls": {      "Flow 1": "https://hooks.example.prismatic.io/trigger/EXAMPLEGbG93Q29uZmlnOmRlNmNmNDMyLTliNWMtN0005NDMxLTRmYzA4ZjViODgxOA=="    },    "webhookApiKeys": { "Flow 1": ["abc-123"] },    "customer": {      "externalId": "customer-example-external-id",      "name": "John Doe"    }  }}

Actions#

Send SMS#

Send an SMS message | key: sendSMS

InputKeyNotesExample

From

string
/ Required
fromThe SMS sender's phone number.5555551234

Message

string
/ Required
messageThe message body of the SMS message.Hello from Prismatic!

To

string
/ Required
toThe SMS recipient's phone number.5551234567

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

Basic AuthbasicBasic authorization using a username/password combination

Username |  username

Password |  password

Output Example Payload#

{  "data": {    "accountSid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",    "apiVersion": "2010-04-01",    "body": "body",    "dateCreated": "2010-04-01T00:00:00.000Z",    "dateSent": "2010-04-01T00:00:00.000Z",    "dateUpdated": "2010-04-01T00:00:00.000Z",    "direction": "outbound-api",    "errorCode": null,    "errorMessage": null,    "from": "+15017122661",    "messagingServiceSid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",    "numMedia": "0",    "numSegments": "1",    "price": null,    "priceUnit": null,    "sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",    "status": "sent",    "subresourceUris": "",    "to": "+15558675310",    "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"  }}