Twilio Use Supported by OCTRI

OCTRI's support for Twilio is limited to the Twilio integration with REDCap, which is limited to sending survey invitations to research participants who have opted into receiving SMS messages.

OCTRI does not manage Twilio accounts for the institution or provide support for any other use of Twilio outside of survey invitations within REDCap.

There are cost associated with Twilio - please see the call out panel to the right.



Please note: In the Twilio guidance and instruction, we will refer to REDCap features and functionality common to all survey projects and covered in detail in our Basics and Survey trainings. These common survey features and functionality will not be described in detail.


Overview

The Twilio integration in REDCap is a paid feature, enabled within individual REDCap projects to text survey invitations to their participants.

The setup, in brief:

  1. Study teams set up and fund their own Twilio accounts and purchase a phone number for each REDCap project they want to use with Twilio
  2. The study team gets help from the REDCap Team to set up their REDCap project to use their Twilio number to send survey invitations

The majority of study teams that use the REDCap Twilio integration are projects with rolling-enrollment that are survey-heavy. These projects typically have at least one survey that needs to be completed at more than one time point, for example, a daily diary or daily pain management survey that needs to be completed every day for number of days in a row.

Set Up Takes Time

There are a number of factors that make setting up a project using the Twilio integration take longer. To start with, Twilio projects are survey projects, the scope and complexity of which necessitate using Automated Survey Invitations (see side bar "Why Automated Survey Invitations"). As a rule, these types of projects have a longer development time. In addition, the study team needs to set up the Twilio account, which can take 4 to 8 weeks, secure funding for the fees and charges to fund their Twilio account and provide billing information for the costs associated with REDCap Team's help, and work through any regulatory and privacy considerations for using Twilio for their study.

Key Considerations - is Twilio a good fit?

The considerations below are intended to help study teams make an informed decision about using Twilio and how to best time the initial request to the REDCap Team to enable Twilio for their project, as well as planning a realistic timeline for the implementation of the SMS delivery method into their survey invitations. 

  • Acceptable Use Considerations

    • The REDCap Twilio integration can only be used for sending SMS messages to invite or remind consented research participants to complete a REDCap survey

  • Twilio Considerations: There are multiple steps to setting up a Twilio number with the vendor, which the study team is responsible for, including:

    1. Creating a Twilio account
    2. Purchasing a number (cannot use a single number in multiple REDCap projects)
    3. Funding the account
    4. Registering a brand campaign within Twilio

Completing these tasks can the take up to 4 weeks, for a non-toll free number, to up to 8 weeks for a toll-free number. The study team will need access to a credit card to fund their Twilio account.

  • Regulatory and Privacy Considerations

    • The REDCap Twilio integration can only be used for sending SMS messages to invite or remind participants to complete a REDCap survey. 
    • Study teams will need to modify their protocol to describe the use of Twilio to communicate via SMS with their participants.
    • Participants must explicitly opt in to receiving texts before the study team can send any SMS survey invitations, and participants can always opt out.
    • SMS invitations cannot include the participant identifiers other than the participant provided phone number, specific care information (e.g., meds, diagnoses/conditions, etc.), or study names or email addresses that could link a participant to a health care condition or disease. 

  • Working with the REDCap Team Considerations

    • After the study team has completed the steps above under "Twilio Considerations" there are additional steps to implement Twilio in a project. The project Point Person will work the REDCap team to configure their REDCap project to use their Twilio account and set up their survey invitations to use their Twilio number. This is typically done over the course of 2 to 3 weeks, with 1 hour devoted to each meeting. See below for description of each meeting encounter. 
    • Prior to the first meeting with the REDCap Team, the study team should already have built the project out significantly, including:
      • The main project settings are finalized
      • Any forms that will impact survey deployment have been developed and tested,
      • All surveys have been developed and tested.


Support Track Availability

Twilio use in REDCap is an optional advanced functionality that can only be enabled or installed by a REDCap admin and requires special instruction & support.

Estimating Twilio Costs

REDCap Team Assistance for Twilio: see Costs Page 


Paid to directly to vendor:

Monthly fee for the phone number.


Charges for each message sent and received.

Twilio splits messages over 160 characters into 153 character segments, which it sends as separate messages that are recombined on the recipient's device.

Twilio bills per split segment message.

Study teams should factor into the message length, the survey link [survey-link] that REDCap adds to SMS invitations. This link is transformed into a clickable URL, which is approximately 50 characters. (SMS does not support html links).

Once a study team has built out their surveys in their project, they can determine the exact character length of a survey's URL by creating a test record and sending themselves an invitation.

The URL character length should be factored into the length of the message. 


Twilio pricing links


Why Automated Survey Invitations

Without using Automated Survey Invitations (ASI), most teams would need to hire a scheduler to manage survey deployment. This is because sending a survey invitation involves determining:

1) Is a participant is eligible for a particular survey

2) If the participant opted into texting

3) If both of the above are true, is texting or email their preference

4) Checking to be sure the participant has not dropped out or rescinded their consent (both for the study and for receiving SMS messaging). 

All of these checks can be programmed into an Automated Survey Invitation, which is more efficient and greatly reduces the chance of sending surveys to participants who should not receive them. In short, ASIs:

  • Reduce study team burden throughout the life of the project
  • Reduce compliance risks
  • Ensure the participant preferences are upheld. 





Description

Twilio is a third-party communications service that supports texting. REDCap has a backend integration to the Twilio API, so that a REDCap project can be enabled to use the study team's Twilio account to send SMS survey invitations to participants.

Feature Type

Optional module available on every project.

Fees

  • One-time fee for projects in development - for current pricing see COSTS
  • Additional fees paid directly to the vendor for purchasing and funding the study team account and Twilio phone number.
    • More information in the Twilio callout box on the right.

Eligible Projects/Project Status Dependency

  • Survey projects sending invitations to prompt participants to complete their study surveys
  • Project Status at Setup = Development
  • Support Track = Standard Service for Research

Enabling Twilio after a project has been moved to production and started data collection is permissible, but not recommended. It is high impact change that requires custom support for set up and testing, and for which there would be additional charges beyond the one-time fee.

Acceptable Use

Acceptable use of Twilio in REDCap is regulated by OHSU's IRB and OHSU's IPS office.

  • The REDCap Twilio integration can only be used for sending SMS messages to invite or remind participants to complete a REDCap survey
  • Use of the REDCap Twilio integration is only available for human subjects research projects.

Prohibited use cases:

  • The REDCap Twilio integration cannot be used for participants to complete Twilio voice or text surveys.
  • The REDCap Twilio integration cannot be used to send participants SMS appointment reminders or other messages regarding study participation or operations.

Twilio Account Requirements

  • Twilio cannot be set up with a non-Twilio phone number.
  • A single Twilio phone number cannot be used for multiple REDCap projects.
  • Trial or test Twilio accounts cannot be used.

Request Process

  • Two-step request process detailed below.
  • In completing the request form, the study team will need to access to an Alias and FAID for billing purposes.

REDCap Skills, Experience, Knowledge

  • Minimum:
    • Basics training completed.
    • Survey training completed.
  • Recommended:

    • Experience building and managing a REDCap survey projects using Automated Survey Invitations.

Installation, Configuration and Implementation

User Permissions

  • User setting up the module will need permission enabled for the Project Design & Setup user right.
  • User setting up the survey invitations module will need permission enabled for the Survey Distribution Tools user right.

Help and Support

  • Custom support from the REDCap Team: available at additional cost, to help with configuration, set up and implementation. 
  • Email and drop-in help, at no charge, are available for troubleshooting the Twilio implementation once the project is launched to production.

Set Up and Operations



Tips for Getting Started

There is not a definitive place to get started with using Twilio. Instead, there is a list of things that need to get done before the REDCap Team can help you set up your project to use your Twilio account. The following four items, Request Twilio for Your Project, Set up Twilio Account and Purchase Number, Address Regulatory Requirements, and Prepare to Meet with REDCap Team, are not presented in a linear fashion, as in Step 1, Step 2, Step 3, Step 4. The order in which these items are completed is at the discretion of you and your team. Note, you must have access to billing information, to set up your Twilio account and send your Twilio request form to the REDCap team.



Request Twilio for Your Project

Requesting Twilio for your project is a two-step process. The project point person is expected to complete the forms described below, and will need to know the Alias, FAID and name of the FAID owner that can be submitted for the costs associated with REDCap team assistance (separate from direct vendor charges).

  • Step 1
    • Complete the request Twilio Request form in the REDCap project you plan on using Twilio for.
      • Find the button to open the form in the Project Setup tab > Enable optional modules and customizations > Twilio Request button

    • Submit project and billing information, including Alias and FAID numbers and the name of the FAID owner.

  • Step 2
    • The REDCap Team processes the request and sends the requestor a link to a form that has both:
      • Instructions for setting up a Twilio account and purchasing a number, and
      • Fields for collecting the Twilio account information. Please see below.  
    • Submit the form after:
      • The Twilio number has been purchased
      • The account has been funded
      • The registering the brand campaign has been completed. More information on this is listed below.



Set up Your Twilio Account and Purchase a Twilio Number

Visit Twilio.com and complete the following tasks:

Set up a Twilio account.

  • Trial or test accounts cannot be used with a REDCap project.

Fund your account Twilio account via the Billing page.

  • Your Twilio account must be funded.
  • The Twilio module will not work with a demo account.

Purchase a number via the Phone Numbers page.

  • Find Phone Numbers in the Products & Services sub-menu by clicking the circle with three dots inside it in left hand navigation
  • Twilio in REDCap can only be used for texting. The number does not need voice or faxing capabilities.
  • A single Twilio number cannot be used for multiple REDCap projects.
  • Tip: some study teams have reported that there are fewer issues with toll free numbers being blocked by mobile providers and phone carriers.

If purchasing a toll-free number, Twilio requires additional verification before the number will be approved including:

  • Screenshot of the electronic survey where end users provide their phone number and opt-in to SMS messaging.
  • Photo or screenshot of the keyword or QR code where end users opt-in to SMS messaging.
  • Screenshot documenting if users opt-in to SMS messaging via voice, such as a checkbox on a form.
  • Scan or photo of the paper form where end users opt-in to SMS messages.

Disable the Request Inspector

  • The Twilio feature named the 'Request Inspector' causes all activity to be logged in detail and stored on Twilio's servers. 
  • To disable the Request Inspector in your Twilio console:
    • Find the Request Inspector on the Settings page, under Programmable Voice. Once there, disable the Request Inspector and click Save. 

Register your brand and campaign with Twilio.

  • For local numbers, expect this process to take between 2-4 weeks.
  • For toll-free numbers, expect this process to take between 6-8 weeks.



Address Regulatory Requirements for Using Twilio

Describe Using Twilio in Your Protocol

Add the following language to your protocol: Survey invitations and reminders will be sent by email or SMS text message [specify the method(s)] to study participants.

Describe Using Twilio for Sending Survey Invitations in Your Consent 

The following language was provided by the IRB.

After you join the study, you can choose to receive text messages as part of the study. These messages will include all future survey links and reminders by text message. If you agree to receive text messages, you are giving us permission to share the personal phone number you give us with our vendor Twilio Inc. to send you these text messages. You do not have to agree to receive text messages to be part of this study. 

Text messages may contain information that you wish to keep confidential. Text messages travel over unencrypted networks that OHSU does not own or control. There is a risk that these text messages could be viewed and read by someone else. By agreeing to receive text messages you agree that OHSU may send your information across those unencrypted networks. OHSU is not responsible for cell phone carrier charges. Your cell phone provider may bill you for the cost of any text messages used for this study. Please check with your cell phone provider for more information. 

We cannot promise that no one else will see a text message from OHSU. For example, if you lose your cell phone or you let someone else use your phone, that person might see text messages from OHSU containing your health information. You should not agree to receive text messages if you share your cell phone with someone else.  

You may choose to stop receiving text messages at any time by sending an email to [studyemail@ohsu.edu] or calling this number [xxx-xxx-xxxx], and we will stop sending you text messages. 

Submit your Text Invitations for IRB Approval

All SMS messages should be submitted to the IRB for approval. The guidance, below, regarding content is regulated by OHSU's IRB and OHSU's IPS office.

  • Do not include participant identifiers other than the participant provided phone number.
  • Do not include specific care information (e.g., meds, diagnoses/conditions, etc.).
  • Do not include study names or email addresses that could link a participant to a health care condition or disease. 

All SMS texts that do not meet these standards must go through an IPS policy exception process. 



Prepare for Meeting with the REDCap Team

Preparing your to meet with the REDCap Team involves both getting your project ready for using Twilio, getting your project ready to work on survey invitations, and planning for how to work with the REDCap to contextualize the Twilio configuration in the your project's setup

Twilio Configuration Considerations

The default configuration for projects using Twilio is to use a Survey Management data entry form to record each enrolled participant's current opt-in decision for texting, as well as their preference for receiving survey invitations. Both the opt-in decision and the preference of each participant will be used as conditions (logic) for sending survey invitations to participants. Before the study team can text an SMS survey invitation to a participant, a participant must consent to the study and explicitly opt in to texting. Additionally, participants can always opt-out of receiving texts later, and they can exert a preference for receiving email invitations instead of text invitations. For this reason, a Survey Management form is used to enable the study team to maintain the current opt-in status and preference of each participant through the life of the study. 

If receiving text invitations is part of your study's intervention, and individuals cannot participate in your project if they opt out of receiving texts, the REDCap Team will work with you to set up your project to meet these requirements.

Considerations for How the Twilio Configuration Works in Conjunction with Surveys and Survey Invitations

  • For any invitations that the study team manually compose and schedule, email will be the default method for sending the invitation, but the study team can opt to change the send method to SMS.

  • For the Automated Survey Invitations (ASI) the study team builds, when Twilio is enabled, the following a new setting appears in the ASI definitions: Invitation Type. This new setting defines the method for sending the invitation to the all the participants eligible to receive the invitation. There are three Invitation Types: 1) Email, 2) SMS, and 3) Use participant's preference. The table here illustrates how the system will deploy an invitation depending on the Invitation Type and Participant Preference settings. 
    • Invitation TypeParticipant PreferenceInvitation Sent Via
      EmailEmailEmail
      EmailSMSEmail
      SMSEmailSMS
      SMSSMSSMS
      Use participant's preferenceEmailEmail
      Use participant's preferenceSMSSMS


    • For invitations that can be sent via text, the default recommendation is to set up the Invitation Type to Use participant's preference. That way the study team can account for individual participant's opting out of texting or changing their preference by updating fields in a the participant's, instead of manually deleting and rescheduling invitations for the participant.

  • For surveys with Save and Return enabled
    • The Save & Return message, generated by REDCap, is sent to the participant’s email address, as designated in REDCap, not their phone number.

    • If an email address has not designated for the project or the survey, the participant will be prompted to enter an email address to receive the Save & Return message.

 Project Specific Preparations for Building Automated Survey Invitations

  • Finalize the main project settings
    • i.e. if a survey is repeated at different time points, longitudinal is enabled, events have been created for the time points and surveys have been assigned to the event
  • Build and test any forms that will impact survey deployment/survey collection.
  • Build and test all surveys.
  • Create test records the REDCap Team can use for testing
    • These records should represent participants eligible for the surveys (but the surveys should not yet be completed).

Twilio Specific Preparations

Two Requirements

  • Capture the participant's phone number in a phone number validated text field.


  • Capture the participant's opt-in decision for texting in a radio button field.
    • The IRB requires that opt-in language for texting be must delivered to the participant and received by the study team in writing. Options for accomplishing this include in a REDCap survey, e-mail to study team, letter, etc.

    • To include opt in language on a REDCap survey, add a radio button with the following attributes 
      • Field Type: Multiple Choice - Radio Buttons (Single Answer)
      • Field Label: I agree to receive text messages for this study and understand that OHSU cannot guarantee they will be confidential.
      • Choices
        • 1, Yes, I agree
        • 0, No, I decline
  • Optionally: Capture the participant's preference for receiving survey invitations in radio button field with the following attributes: 
    • Field Type: Multiple Choice - Radio Buttons (Single Answer)
    • Field Label: Default invitation preference
    • Choices
      • EMAIL, Email invitation
      • SMS_INVITE_WEB, SMS invitation (contains survey link)


Best Practices 

If your study plans on using REDCap for collecting the data above directly from the participant via a survey, use of a data entry field to manage surveys is the best practice, see above under "Twilio Configuration Considerations." If you are using REDCap for e-consenting, the best practice is to collect the items in a survey that follows e-consent, then work with the REDCap Team to pipe these values into a data entry form the staff can use for survey management. Piping these values into corresponding fields in data entry form removes the possibility of directly editing a participant reported survey (never recommended) and reduces the chance of the study staff overwriting any other responses that may be collected in the same survey as the items above. Additionally, if you added a radio button to capture the participant's opt-in decision for texting to your e-consent, it is an IRB requirement that the e-consent survey can't be updated, to reflect a participant changing their initial decision, you must have a method to manage that change elsewhere. 



Meet with the REDCap Team - Meeting 1

Before the meeting the REDCap Team member will enter the Twilio account information you submitted during the request process (see above under "Request Twilio For Your Project, Step 2") into your REDCap project and try to text themselves an SMS invitation. If the invitation fails to send, this typically means that all the registration steps have not been completed, or the account is not funded. The team member will contact you in the event this happens.

Meeting Overview

  • Meeting Duration: 1 hour

  • Meeting Focus: The focus of the first meeting is to configure your project to use your Twilio account and start work on your Automated Survey Invitations. 

    By default every project is configured for the study staff to record in a data entry form each enrolled participant's opt-in decision for texting, as well as their preference for receiving survey invitations, both of which will be used as conditions for texting SMS survey invitations to participants. This is because before the study team can text a participant an SMS survey invitation, a participant must consent to the study and explicitly opt in to texting. Additionally, a participant can always opt out of receiving texts, and even for participants who do opt in to receiving texts, they can still exert a preference for receiving email invitations instead of text invitations.

  • Note: You will need to have access to the Twilio account during this meeting.

Standard Agenda

Below is the standard agenda the REDCap Team works from for the first meeting.

Twilio Specific

  • Review how study team's Twilio account information is captured in the project.  
  • Confirm request inspector has been disabled.
  • Review in what form or survey the following information is being captured:
    • Participant's phone number
    • Participant's opt-in decision for texting
    • Participant's preference for receiving survey invitations
    • If these item are collected in one or more survey's, pipe the responses into corresponding fields in a Survey Management form.
  • Configure the Twilio project settings
  • Manually text an SMS survey invitation to the point person
    • Point person confirms they received the text
  • Create test records to demonstrate how the participant's preference for invitations is stored in the Participant List.
  • Demonstrate that Twilio numbers are not monitored for incoming texts or phone calls.
    • Point person confirms this by replying to SMS invitation and review response with point person
  • Set up generic response for any participant text replies and test response
    • Log into Twilio

    • In the left hand navigation menu, scroll to the bottom and click Explore Products.


    • On the Explore Products page, scroll down to Developer Tools and click TwiMl Bins.


    • On the TwiML Bin page, click the blue + sign


    • Configure a TwiML 
      • Friendly Name = enter a name for the auto-responder such as (Name of your study) Auto-Responder
      • TwiML =
        <?xml version="1.0" encoding="UTF-8"?>
        <Response>
        <Message>Your contact info</Message>
        </Response>
      • The <message> is the participant-facing messaging and must be approved by the IRB.

    • Scroll down and click the blue Create button.


    • Navigate to your phone number using one of the following methods:
      • Method 1
        • Click on the Dashboad link at the top of the left hand navigation menu
        • On the Dashboard page, scroll down to the Account info
        • Click on the View all numbers link next to the your twilio phone number

      • Method 2
        • Click on the Phone numbers near the top of the left hand navigation menu
        • In the expandable menu, click on the Manage link
        • In the expandable Manage menu, click on the Active Numbers link


    • Click the number to which you want to add the auto-responder message

    • On the phone number page, scroll down to the Messaging Configuration section:

      • Configure With dropdown menu =  Webhook, TwiML Bin, Function, Studio Flow, Proxy Service
      • A Message Comes in = TwiML Bin
      • TwiML Bin = The option identified by the Friendly Name you provided in step 5
      • Click the blue Save Configuration button.


    • Test that your auto-responder is working by sending a text message to your Twilio number.
  • Review some Twilio nuances
    • How automated Save and Return message works for surveys participant was invited to texting an SMS.
    • How Twilio charges for messages sent and received.

Automated Survey Invitations (ASI)

  • Review how the Twilio configuration works in conjunction with the ASI setup.
  • Gather requirements for surveys that can be sent via text and if the project is set up to meet the requirements

For many projects Meeting 1 ends here, especially if the project setup issues are identified that impact meeting the requirement for survey deployment or if issues were identified earlier during Twilio configuration that required some restructuring of the project.

Bonus Activities (if set up is smooth and time allows)

  • Set up at least one ASI with a pattern that the point person can implement in other ASIs.
  • Test the ASI and review how to test the ASI.
  • If time allows set up and test ASIs for other surveys.

Meet with the REDCap Team - Meeting 2

Before the meeting if any ASI's were set up, the REDCap Team member will check if some testing has been completed. In the event testing is incomplete, the REDCap team member will contact you to re-scheduling the meeting.

Meeting Overview

Meeting Duration: 1 hour

Meeting Focus: The focus of the second meeting is to address any project setup issue that were identified in Meeting 1 and start/or continue work on the Automated Survey Invitations (ASI) for the surveys that can be sent via text. Depending on the complexity of the survey deployment requirements and the number ASIs that need to be set up, the effort to define and test ASIs can be significant. 

Standard Agenda

Project Setup Issues, if they were identified in Meeting 1

  • Follow up any issues that were identified that needed to be addressed before building out ASIs.

Automated Survey Invitations

  • Review testing on ASI that completed after Meeting 1
  • Review any ASI that were created after Meeting 1
    • Spot test ASI
  • Define new ASIs
    • Test ASIs
    • Review how to test ASIs
    • Review with point person how to implement new ASI patterns


Meet with the REDCap Team - Meeting 3

Before the meeting the REDCap Team member will check if some interim testing has been completed, based on the work completed in Meeting 2. In the event testing is incomplete, the REDCap team member will contact you to re-scheduling the meeting.

Meeting Overview

Meeting Duration: 1 hour

Meeting Focus: The focus of the third meeting is to finalize work on the Automated Survey Invitations (ASI) for the surveys that can be sent via text. Depending on the complexity of the survey deployment requirements and the number ASIs that need to be set up, the effort to define and test ASIs can be significant.

Standard Agenda

Automated Survey Invitations

  • Review testing on ASI that completed after Meeting 2
  • Review any ASI that were created after Meeting 2
    • Spot test ASI
  • Define new ASIs
    • Test ASIs
    • Review how to test ASIs
    • Review with point person how to implement new ASI patterns

  • No labels