Send Text Messages with Twilio

December 8, 2021
Juan Carbajal

Twilio is a service that lets you send text messages programmatically using a RESTful API. We've wrapped the /Accounts/{AccountSid}/Messages.json endpoint from the Twilio API as an Action called SendTwilioSMS.

NOTE: This tutorial requires a Twilio account. If you don't have a Twilio account yet, that's ok! Message us and we'll send you a set of keys to test with.

To get started, search for "twilio" in the Actions section of the Dashboard and select SendTwilioSMS

The Action will appear with required attributes, like so:

In the columns on the left, you can add the content of the text message in the Body, the recipient's phone number in To, and one of your Twilio phone numbers in From. The text you add is treated as JavaScript, so you need to wrap your messages in quotes:

Note: Twilio's API expects phone numbers to begin with a '+', followed by a country code, then the 7 digits with no spaces (E.164 format). For example, a US phone number of (313) 123-4567 would be sent as "+13131234567", with the quotes.

With the required fields all filled out, we now need to use the Configure button on the action to add credentials:

In the configuration panel, add your Action Sid and Auth Token and hit Save:

At the bottom of the Dashboard, use the Save & Rebuild button to push your changes:

You'll get a message when your changes are live:

If everything went correctly, the recipient will receive a text message every time the action is triggered. Read about how to trigger Trivial actions here.

Notes on credentials:

To access your own credentials, log into Twilio at https://www.twilio.com/login. After logging in click on Account > General Settings in the top navigation bar. Under General Settings there will be a section labeled Auth Tokens.

The Auth Tokens section contains two sets of credentials - a Live set that charges your Twilio account and a Test set that does not. Find more on Twilio Test Credentials here.

When copying an Auth Token from Twilio, make sure to reveal it before copying it to ensure the correct value gets copied.

Why Trivial?

Build processes & workflows your team will love, 10x faster than writing code by hand — without giving up privacy, security, or flexibility.

Try for Free

Faster

Jump into Trivial's no-code builder and deploy complex workflows in minutes.

Cheaper

Save countless thousands of dollars in custom development, while shipping faster than ever before.

All yours

With Trivial, you own your source code. Customize, access and export your code anytime, anywhere.