Twilio

The Twilio service allows you to send automated text/sms/mms messages from your app using the Twilio API.


Profile Settings

NOTE: All profile settings are encrypted and stored in Zingy's cloud infrastructure.

Account SID

Enter your Twilio Account SID here.

API Key (optional)

Twilio allows you to use its API services using either Auth Tokens or API Keys with Key secrets.

If you plan on using API Key, enter the value here.

Click here for more information.

Auth Token/API Key Secret

If you entered a API Key above, enter the API Key Secret value here. If not, enter your Twilio account's Auth Token value here.

Click here for more information on Auth Token vs API Keys.


Connection Settings

The Twilio service does not have any connection specific settings.


Operations/Commands

The Execute Connection Command block is available in both Page Flow and Cloud Flow. Using this block you can add logic to trigger the operations/commands supported by the Sendgrid service.

For security purposes, all operations/commands offered by the Twilio service are only available in Cloud Flow and cannot be used in Page Flow.

Send Message

Use this command to send a text/sms/mms using the Twilio service.

Input Data

When invoking this operation, an object with the following properties is required:

PropertyTypeDescription

fromPhone

A registered and approved origination phone number in E.164 format.

fromService

Optional. If sending the message as part of a campaign, specify the Message Service SID here.

toPhone

The recipient phone number in in E.164 format.

msg

The message body.

customProps

Optional. For advanced users, this specifies an object with properties based on parameters used by the Twilio API.

Output

Object containing information about the message. Please refer to the Twilio API documentation for details.

List Messages

Use this command to list messages in your Twilio account.

Input Data

When invoking this operation, an object with the following properties is required:

PropertyTypeDescription

criteria

Optional. Object containing criteria for listing as specified by the Twilio API.

limit

Optional. Limit the number of messages listed per page.

Output

List of messages retrieved based on the criteria specified.

Read Message

Use this command to retrieve/fetch a specific text/sms/mms message in your Twilio account.

Input Data

When invoking this operation, an object with the following properties is required:

PropertyTypeDescription

sid

The unique Message SID identifying the message to be read.

Output

Object representing the message.

Update Message

Use this command update properties of a text/sms/mms message in your Twilio account. This command is usually used to redact a message.

Input Data

When invoking this operation, an object with the following properties is required:

PropertyTypeDescription

sid

The unique Message SID identifying the message to be updated.

customProps

Object containing properties to be updated. Please note that Twilio restricts specific properties from being updated based on the status of the message.

Output

Object containing information about the message. Please refer to the Twilio API documentation for details.

Delete Message

Use this command delete a text/sms/mms message in your Twilio account.

Input Data

When invoking this operation, an object with the following properties is required:

PropertyTypeDescription

sid

The unique Message SID identifying the message to be deleted.

Output

This command does not provide any output beyond the Success/Fail status.


Advanced Functionality

In your app's Cloud Flow Web Hooks and Background Tasks, the Custom Code block can be used to access and implement advanced functionality related to the Twilio messaging service.

To access the Twilio client initialized with credentials saved on this Twilio service connection, see the following example:

// To use a twilio client initialized with credentials provided 
// in a Twilio connection
const client = zingyConn.twilio(connectionName);

You may also initialize a seperate Twilio client, by specifying account credentials directly:

// To create a new twilio client specifying account credentials
const client = require('twilio')(accountSid, authToken);

After the client object is initialized, you can use it to call into the Twilio library. Refer to Twilio library documentation for more information.

Last updated