How to Configure Twilio Texting (SMS) Service in REDCap

Summary

REDCap integrates with the 3rd party Twilio service to invite participants to complete their surveys using either a voice (text to speech), call, or SMS text messaging. This article describes how this service works and the basic setup steps.

 

Introduction

REDCap has the capability to make voice calls and send SMS text messages to survey respondents by using a third-party web service named Twilio. In this way, you could invite a participant to take a survey by sending them an SMS message or by calling them on their phone, in which the data would be collected in REDCap directly from their phone without having to use a webpage. There are many different options available for how you can invite participants and how they can take your surveys, either as a voice call survey or as an SMS conversation.

 

Usage

Twilio Account Setup

To use this feature, you must have a Twilio.com user account that is funded with some money (since there is a cost for each phone call made and for each SMS message sent). If you do not have a Twilio account, it is very easy to go to Twilio.com and create one. (Michigan Medicine research teams should use their @med.umich.edu account to signup, which would automatically add them to the enterprise license provided by HITS).

Before you begin the setup steps below, you must 1) set up your own Twilio account at twilio.com. Once your Twilio account has been created, you must 2) fund your account with some money (using the Billing page in Twilio) and then 3) purchase a phone number to be used for this REDCap project (see the Numbers page in Twilio).

In the Project Setup page of REDCap, under "Enable optional modules and customizations", there is a button to enable Twilio SMS services. However, only REDCap administrators can enable this. Contact MICHR support to enable the module in your project.

Uploaded Image (Thumbnail)

Once the module is enabled and a phone number has been purchased for the account, obtain the Account SID and Auth Token for your account (see the API Credentials section on the main Account Settings page), and then enter the Account SID, the Auth Token, and the phone number into the "Twilio account credentials" section below. Note: Whenever you set the services as Enabled below and then click the Save button, REDCap will check with your Twilio account to confirm if all the credentials and info are correct. REDCap will not allow you to enable the Twilio SMS and voice call services below until it has verified that the Account SID, Auth Token, and phone number are all valid.

 

Setup & Configuration

Once your REDCap project is connected to your Twilio account by entering your Twilio account credentials on your REDCap project's Project Setup page, you can then configure how you want to use Twilio in your project. In general, not much is different between administering a survey normally in REDCap than when using Twilio SMS/voice calls except that you additionally choose how your survey invitations are delivered. The following choices are available:

  1. Initiate survey as voice call
  2. Initiate survey as SMS conversation
  3. Send survey invitation with survey link via SMS
  4. Send survey invitation via SMS to take survey as voice call (respondent makes call)
  5. Send survey invitation via SMS to take survey as voice call (respondent receives call when replying via SMS).

Any or all of these invitation delivery methods can be utilized within a single project. The choice of delivery method completely depends upon your specific use case for how you want to collect data from your participants.

Twilio can be enabled in a project that is already in Production status as it's an administrator-only task, but other than enabling the feature any project-level implementation would be up to the study team to determine based on their study-specific needs.

Voice Call Surveys

When participants take a survey as a voice call, questions are asked one at a time, in which the Twilio service will use text-to-speech technology to read the questions to the participant audibly on their phone. You may choose the language and/or dialect in which the text should be read. Participants will respond by entering numbers on their phone's keypad, thus only numeric responses can be used because of this limitation (this includes the use of integer/number fields and also multiple choice questions with numeric codes, in which the participant will enter the numeric coded value on their keypad, not the label that is read to them over the phone). For example, the question might be a Yes-No question, which might look like "Do you like ice cream? Yes, press 1. No, press 0"; or a number question like "What is your age?"

SMS Surveys

When participants take an SMS survey, questions are asked one at a time as an SMS text message conversation/thread. SMS surveys provide more response possibilities than voice calls. While participants in voice calls can only respond with numbers, they may respond with any kind of alpha-numeric text for an SMS survey. Note: Only REDCap administrators are allowed to enable the Twilio option to initiate a survey as an SMS conversation. Much like email, SMS is not considered a secure form of communication, so you may not want to administer surveys as SMS conversations if the participant will be submitting identifying information (PHI or PII), unless you have been granted special permission from the participant to do so (and have consulted with Information Assurance). Given such sensitive privacy issues, only your local REDCap administrator can enable the optional setting to use SMS surveys. Please notify your administrator about this if you wish to have this option enabled.

 

Other Considerations

 

Compatibility

Most of REDCap's survey features still function much the same when taking a survey via SMS or as a voice call. This includes the enforcement of required fields, field validation, branching logic, using the Survey Queue for multiple surveys (only works with Auto-Start enabled), survey email notifications and confirmations, the Participant List, Automated Survey Invitations, survey Stop Actions, and computer adaptive tests (CATs) downloaded from the REDCap Shared Library. One of the few survey features that is not compatible is the Survey Login feature.

 

Cost

In order to use the Twilio SMS and Voice Call services in a REDCap project, you will have to connect your project to your Twilio account by entering your Twilio credentials into REDCap during the setup process. And as REDCap makes calls and/or sends SMS messages using this service, all charges to your Twilio account will be made based upon its usage. This is not done by REDCap but is done internally by Twilio as you use its services. In this way, no monetary transactions are made by REDCap, and thus it is your responsibility to maintain the funds in your Twilio account in order to ensure that the service continues to work for your REDCap project. If your Twilio account runs out of funds, the Twilio services in REDCap will cease to function. For information on the cost of each call or each SMS message, visit your Twilio account to view the rates.

 

Privacy & Security

It is important to understand that this feature utilizes the third-party service Twilio.com, which means that all voice calls and SMS messages will be routed through Twilio's servers. However, REDCap goes to great length to ensure that voice call records and SMS transcriptions do not stay in Twilio's logs but are removed shortly after being completed. This is done for security and privacy concerns (e.g., HIPAA), in which your survey participants' phone numbers and their survey responses do not get permanently logged on Twilio's servers but instead remain securely in REDCap. (Note that the Twilio license provided by HITS is for a secure, HIPAA-compliant version of Twilio).

 

If this is a service you are interested in, we would strongly recommend setting up a test project in the REDCap Training environment to familiarize yourself with the use of this service. You'll also need to create your Twilio account and provide MICHR Support with the Account SID, Auth Token, and phone number as instructed. MICHR does not charge anything in REDCap to use this feature, but as a third-party service Twilio does charge fees depending on utilization.

 

Notes

  • Twilio offers both a secure (HIPAA-compliant) and non-secure version. To access the secure version, signup using an @med.umich.edu account, and contact the Academic Applications team in HITS.

 

Resources

 

About the Author

In collaboration with MICHR

MICHR

The Michigan Institute for Clinical and Health Research (MICHR) strives to develop and advance translational science – a field of study that aims to identify and overcome long-standing challenges in the translational research pipeline. MICHR examines translational research at a systems level with the goal of generating scientific and operational innovations that reduce translational barriers and improve the efficiency and effectiveness of all translational research.

Learn more    Contact MICHR Support

 

Print Article

Related Articles (5)

Research is how we learn, but our findings depend upon robust data, derived from the populations we seek to serve. As teams build digital environments for research, effort must be put into ensuring that those environments support the populations of study.
A compilation of software and cloud services for creating forms, surveys, polls, questionnaires, etc. A compilation of software and cloud services for electronic data capture, forms, surveys, polls, questionnaires, etc. Find the right survey tool for business, clinical or research use.
REDCap integrates with the 3rd party Mosio service to invite participants to complete their surveys using SMS text messaging. This article describes how this service works and the basic setup steps.
This article presents a brief overview of how to import XML projects into REDCap, such as those available at the Depression Center's GitHub repository.
Selecting technology to manage a study remotely is a big decision. This article includes considerations for selecting technology and information on vendors that are (at the time of writing) approved for use in research at U-M.