Skip to main content

Twilio

This page provides information for connecting Appsmith to Twilio and reading and writing data in your applications.

How To Send SMS Notifications With Twilio

Connection parameters

The following section is a reference guide that provides a complete description of all the parameters to connect to Twilio.

Configuring a Twilio datasource.
Configuring a Twilio datasource.

Authentication Type

Options:
  • Basic auth: Connect to Twilio using your Account SID and an Auth token issued by Twilio.

Account SID

A unique ID string that identifies your Twilio account. You can find this on your Twilio Console under the Account Info section.

Auth token

A token string used to authenticate your queries. You can find this on your Twilio Console under the Account Info section.

Query Twilio

The following section is a reference guide that provides a description of the available commands with their parameters to create Twilio queries.

Configuring a Twilio query.
Configuring a Twilio query.

Create message

You can use this command to create and send a message to a specific phone number. The following section lists all the available parameters:

Twilio account SID

A unique ID string that identifies your Twilio account. You can find this on your Twilio Console under the Account Info section.

To

The phone number to which the message should be sent. Be sure to follow E.164 format: +15551234567.

From

The Twilio phone number from which the message should be sent. Be sure to follow E.164 format: +15551234567. Once you've created your Twilio phone number, you can find it in the Twilio console under the Account Info section.
info

To send a message to a WhatsApp phone number, see Using Twilio Phone Numbers With WhatsApp.

Body

The text content of the message.

Schedule message

You can use this command to create and schedule a message for sending at a future date and time. The following section lists all the available parameters:

Twilio account SID

A unique ID string that identifies your Twilio account. You can find this on your Twilio Console under the Account Info section.

Messaging service SID

A unique ID string that identifies a messaging service that you create on your Twilio account. You can find or create the service in the Twilio Console under Explore Products > Messaging > Services.

To

The phone number to which the message should be sent. Be sure to follow E.164 format: +15551234567.

Body

The text content of the message.

Send at

A string that defines the date and time to send the message. The given date must be between 15 minutes and 7 days from the time of the request and must be in UTC format YYYY-MM-DDTHH:MM:SSZ.

List message

You can use this command to fetch a list of past messages sent from a specified Twilio phone number. The following section lists all the available parameters:

info

To fetch scheduled messages that haven't been sent, leave the To, From, and Date Sent fields empty.

To

The phone number to which the message was sent. Be sure to follow E.164 format: +15551234567.

From

The Twilio phone number from which the message was sent. Be sure to follow E.164 format: +15551234567. Once you've created your Twilio phone number, you can find it in the Twilio console under the Account Info section.

Date Sent

A string that defines which date to fetch records from. Must be in the format YYYY-MM-DD.

Page size

The maximum number of records to fetch in your query.

Twilio account SID

A unique ID string that identifies your Twilio account. You can find this on your Twilio Console under the Account Info section.

Fetch message

You can use this command to fetch the body and send status of a specific message. The following section lists all the available parameters:

Twilio account SID

A unique ID string that identifies your Twilio account. You can find this on your Twilio Console under the Account Info section.

Message SID

A unique ID string that identifies the message. You can get the Message SID from a List message query on the sid property, or when you create a new message with a Create message query.

Delete message

You can use this command to delete a specific message. The following section lists all the available parameters:

Twilio account SID

A unique ID string that identifies your Twilio account. You can find this on your Twilio Console under the Account Info section.

Message SID

A unique ID string that identifies the message. You can get the Message SID from a List message query on the sid property, or when you create a new message with a Create message query.

Cancel message

You can use this command to cancel sending a specific scheduled message. The following section lists all the available parameters:

Twilio account SID

A unique ID string that identifies your Twilio account. You can find this on your Twilio Console under the Account Info section.

Message SID

A unique ID string that identifies the message. You can get the Message SID from a List message query on the sid property, or when you create a new message with a Create message query.

Troubleshooting

If you are experiencing difficulties, you can refer to the Datasource troubleshooting guide or contact the support team using the chat widget at the bottom right of this page.