Twilio Connector Setup Guide

This article describes how to set up the Twilio connector.

Connector Actions

Action Name AudienceStream EventStream
Send SMS or MMS

Configure Settings

Go to the Connector Marketplace and add a new connector. See the Connector Overview for general instructions on how to add a connector.

After adding the connector, configure the following settings:

  • Account SID (username)

    • HTTP requests to the REST API are protected with HTTP Basic authentication.
    • Use your Twilio account SID as the username and your auth token as the password for HTTP Basic authentication.
    • For more information, see: SMS API: Messaging.
  • Auth Token (password)

    • HTTP requests to the REST API are protected with HTTP Basic authentication.
    • Use your Twilio account SID as the username and your auth token as the password for HTTP Basic authentication.
    • For more information, see: SMS API: Messaging.

Action Settings - Parameters and Options

Click Next or go to the Actions tab. This is where you configure connector actions.

This section describes how to set up parameters and options for each action.

Action - Send SMS or MMS

Parameters

Parameter Description
Account SID
  • You can find your Account SID in your console.
  • For more information on this endpoint, see: Sending Messages.
To
  • The destination phone number.
  • Format with a plus sign (+) and country code, in (E.164 format).
  • Example: +16175551212
From
  • A Twilio phone number, in E.164 format, or alphanumeric sender ID enabled for the type of message you wish to send.
  • Phone numbers or short codes purchased from Twilio work here.
  • You cannot “spoof” messages from your own cell phone number.

    You must POST at least one of the following parameters to determine the From phone number or Sender ID of your message: From, Messaging Service SID

| |Messaging Service SID|
  • The 34-character unique ID of the Messaging Service you want to associate with this Message.
  • Set this parameter to use the Messaging Service Settings and Copilot Features you have configured.
  • When only this parameter is set, Twilio will use your enabled Copilot features to select the **From** phone number for delivery.

    You must POST at least one of the following parameters to determine the From phone number or Sender ID of your message:From, Messaging Service SID

| |Body|
  • The text of the message you want to send, limited to 1600 characters.

    You must POST at least one of the following parameters for the content of your message: Body, MediaUrl

| |Media URL|
  • The URL of the media you wish to send out with the message.
  • GIF, PNG, and JPEG content is currently supported and will be formatted correctly on the recipient's device.
  • Other file types are also accepted by the API.
  • The media size limit is 5 megabytes (MB).
  • To send more than one image in the message body, provide multiple `MediaUrls` values in the POST request.
  • You may include up to 10 `MediaUrls` per message

    You must POST at least one of the following parameters for the content of your message: Body, MediaUrl

| |Status Callback|
  • A URL where Twilio will POST each time your message status changes to one of the following:
    • `queued`
    • `failed`
    • `sent`
    • `delivered`
    • `undelivered`
  • Twilio will POST the `MessageSid` along with the other standard request parameters as well as `MessageStatus` and `ErrorCode`.
  • If this parameter is passed in addition to a `MessagingServiceSid`, Twilio will override the Status Callback URL of the Messaging Service.
  • URLs must contain a valid hostname.
  • The underscore character (`_`) is not allowed in the hostname.
| |Application SID|
  • Twilio will POST `MessageSid` as well as `MessageStatus=sent` or `MessageStatus=failed` to the URL in the `MessageStatusCallback` property of this Application.
  • If the `StatusCallback` parameter above is also passed, the `MessageStatusCallback` parameter for the application takes precedence.
| |Max Price|
  • The total maximum price up to the fourth decimal (`0.0001`) in US dollars acceptable for the message to be delivered.
  • All messages will be queued for delivery, regardless of the price point.
  • A POST request is later made to your Status Callback URL with a status change of `Sent` or `Failed`.
  • When the price of the message is above this value the message will fail and not be sent.
  • When `MaxPrice` is not set, all prices for the message are accepted.
| |Provide Feedback|
  • Set this value to `true` if you are sending messages that have a trackable user action and you intend to confirm delivery of the message using the Message Feedback API.
  • This parameter is set to `false` by default
| |Validity Period|
  • The number of seconds that the message can remain in a Twilio queue.
  • After exceeding this time limit, the message will fail and a POST request is later made to your Status Callback URL.
  • Valid values are between `1` and `14400` seconds (default).
  • Twilio cannot guarantee that a message will not be queued by the carrier after they accept the message.
  • We do not recommend setting validity periods of less than 5 seconds
|

Was this page helpful?

This page was last updated: November 10, 2021