Creating Twilio SMS Confirmation for Consent

You can create SMS confirmation for a data subject when logging their consent with Twilio.

Note:

This is not intended to be a comprehensive guide on how to set up or use Twilio. You may need specialized permissions in order to set up and use this integration. Please consult your organization's Twilio administrator and documentation for the most up-to-date information. For more information about Twilio APIs, please see Twilio Docs.

To create a Twilio account

  1. Go to the Twilio website. Select Sign Up to begin a free trial.
  2. When you are finished creating your account, navigate to the Dashboard.
  3. Locate your Trial Number, Account SID, and Auth Token on the Twilio dashboard. You will use this information to integrate Twilio with OneTrust.


To authenticate Twilio with OneTrust

  1. On the OneTrust main navigation menu, click Integrations.

    The Integrations gallery screen appears.

  2. On the Integrations menu, select Credentials.

    The Credentials screen appears.

  3. Click the Add credential button.

    The Create credentials screen appears.

  4. Under the Select existing system dropdown menu, locate Twilio then click the Next button.
  5. On the Enter credentials details screen, complete the fields then click the Save button. For more information, see Enter Credential Details Screen Reference.

Enter Credential Details Screen Reference



Field
Description
Credential name

Enter a name for the new credential.

Description

Enter a description for the new credential.

Application type

Select a connector type option from the following options:

  • Web app

  • Encryption

  • File share

  • Database

  • Decryption

  • Cloud SDK

Authentication method

Select the applicable authentication type required for your web app integration.

Protocol

Defaults to HTTPS.

Hostname

Enter the hostname for the credential. When a credential is associated to a workflow action, the hostname will be the default domain for this action. If a previous domain has been specified on the action, the hostname will replace that domain.

Key (Enter default headers)

Select the type of key which should be used in the header of the call made by the connection. You can add additional keys if your credential requires more than one header.

Value (Enter default headers)

Enter the value of the key which should be used in the header of the call made by the connection.

Token

Provide a token value for the credential.

Allow Mutual Transport Layer Security (mTLS)

Enable mutual transport layer security (mTLS) for all credentials using the Web App connector type to establish secure and trusted connections with external servers. This only applies to outbound connections made by actions in integration workflows which use this credential type.

For more information, see Setting Up Mutual Transport Layer Security.

Server certificate chain

Post a custom server certificate to any HTTPS credential to establish a secure and trusted connection with external systems not using a certificate issued by a trusted authority.

Test settings (recommended)

Enter an URL and test it to verify the credentials.

Classify as sensitive

Enable this setting if the credentials will be used in a sensitive workflow.

Note:

For more information, see Configuring Integration Credentials.

To create an integration workflow for Twilio

  1. On the Integrations menu, select Integrations.
    The Integrations screen appears.
  2. Click the Add integration button.
    On the Add Integration modal appears.
  3. Complete the fields. Select Twilio from the System field list.
  4. Click the Add button to add your Twilio workflow.
    The Integration builder screen appears.
  5. In the Add OneTrust trigger block, select the Consent tab.
  6. Select Data Subject Consent Updated as the trigger.
    The Condition block appears.
  7. Click the Add action button underneath.
  8. Select Send SMS Notification as an action on the System tab.
  9. Use the radio button to select either the Create new credentials option or the Select existing credentials option.
    • If you select Create new credentials, you will need to follow the same set up instructions as in To authenticate Twilio with OneTrust .

    • If you select, Select existing credentials, select the credentials you created on the previous step.

  10. Complete the workflow. For more information, see Integration Builder Block Reference .
  11. Click the Finish button. Then, click the Activate button to launch the workflow.
    Note:

    If you are using the trial version of Twilio, ensure that you add the provided trial number to the Verified Caller IDs list to receive the SMS.



Integration Builder Block Reference



Field
Description
Request URL

Enter the Request URL, ensuring it follows this format: https://api.twilio.com/2010-04-01/Accounts/{TwilioUsername}/Messages.json

Method

Select POST.

Header(s)

Select Content-Type. Enter application/x-www-form-urlencoded in the field on the right.

Body

Copy this text and paste it into the Body field:

PYTHON
<#assign magictoken= (event.payload.contact.MagicLink)?url('UTF-8')>
<#assign magiclink ='Your consent has been received successfully! You can manage your
preferences from the following link:   https://privacyportaltrial.onetrust.com/ui/#/preferences/token/7144f28e-19e5-479f-b9d3-bcf0ccc3dada/${magictoken}'>
<#assign to=(event.payload.contact.Mobile)>
<#assign from='+447723473901'>
Body=${magiclink?url('UTF-8')}&To=${to?url('UTF-8')}&From=${from?url('UTF-8')}

Replace the URL with the magic link URL from the Integrations tab in your organization's Preference center menu.

Replace the phone number with your Twilio Trial Number.

Edit the SMS content to fit your organization's needs.