Event Target for Twilio
This event Target receives CloudEvents and utilizes Twilio to enable the creation and delivery of SMS messages via event-data and event-occurrence, respectively.
Prerequisites
- Twilio account with access to the Account SID & Access Token.
- Phone Number.
Deploying an Instance of the Target
Open the Bridge creation screen and add a Target of type Twilio
.
In the Target creation form, give a name to the event Target and add the following information:
- Default source phone number: Sending phone number, usually configured to the phone number purchased at Twilio. (Optional)
- Default destination: Phone number to send messages to by default. (Optional)
- SID Secret: Reference to a TriggerMesh secret containing the SID of the Twilio account.
- Token Secret: Reference to a TriggerMesh secret containing an API Access token for authenticating requests against the Twilio API.
Both the Default source phone number and Default destination configurations may be overridden by any CloudEvent message received by the Target.
For more information about using Twilio, please refer to the Twilio documentation.
After submitting the bridge, and allowing some configuration time, a green check mark on the main Bridges page indicates that the bridge was successfully created.
Event Types
The Twilio event Target can consume events of any type, however, the Target expects a JSON payload at the CloudEvent with the following properties:
Name | Type | Description |
---|---|---|
message | string | Text to be sent in the body of the SMS message. |
media_urls | string | Array of URLs pointing to JPEG, GIF or PNG resources. |
from | string | Phone number sourcing the communication. Takes precedence over the value from the Twilio Target spec. |
to | string | Phone number of the destination. Takes precedence over the value from the Twilio Target spec. |