Twilio

With the Twilio plugin, you can receive Brightspot notifications to phone via text (SMS) messages.

Developers perform this task.

Step 1: Acquire SMS API Credentials

This section provides the basic steps to acquire an SMS API key from Twilio. Acquiring API credentials for other messaging services is similar.

  1. In your browser, go to https://www.twilio.com/ and click Get a free API key.

  2. In the Sign up for free page, enter your account information and then click Get Started.

    ../../../_images/twilio-signup.png
  3. In the verification page, enter your phone number and click Verify via SMS.

    ../../../_images/twilio-verify.png
  4. In the following response page, enter the verification code you received from Twilio and click Submit.

    ../../../_images/twilio-submit-verification-code.png
  5. Fill out any subsequent forms until you get to the dashboard.

  6. In the dashboard’s upper-right corner, click Show API Credentials.

    ../../../_images/twilio-show-api-credentials.png
  7. Copy the values for ACCOUNT SID and AUTH TOKEN into a text editor.

Step 2: Provision From Numbers

In this step, you provision phone numbers from which Twilio can send text messages.

  1. Navigate to the Twilio dashboard, and click Manage Numbers. The Phone Numbers Dashboard appears.

    ../../../_images/twilio-phone-numbers-dashboard.png
  2. Click Get Started, and in the next page click Get your first Twilio phone number. A widget appears.

    ../../../_images/twilio-first-phone-number.png

    Referring to the previous illustration, the Twilio phone number is (202) 816-4833.

  3. Click Choose this Number. A confirmation widget appears.

    ../../../_images/twilio-confirmation-widget.png
  4. Copy the phone number into a text editor. Referring to the previous illustration, the phone number you copy is +12028164833.

Step 3: Configure Dari for Text Messaging

In this step, you configure Dari to send text messages using the API credentials you acquired in Step 1: Acquire SMS API Credentials and the phone number you acquired in Step 2: Provision From Numbers.

  1. In a text editor, open the Tomcat configuration file conf/context.xml.

  2. Add the following lines:

    1
    2
    3
    4
    5
    6
    <!-- SMS -->
    <Environment name="dari/defaultSmsProvider" override="false" type="java.lang.String" value="twilio" />
    <Environment name="dari/smsProvider/twilio/class" override="false" type="java.lang.String" value="notifications.TwilioSmsProvider" />
    <Environment name="dari/smsProvider/twilio/accountSid" override="false" type="java.lang.String" value="putYourAccountIDHere" />
    <Environment name="dari/smsProvider/twilio/authToken" override="false" type="java.lang.String" value="putYourAuthTokenHere" />
    <Environment name="dari/smsProvider/twilio/defaultFromNumber" override="false" type="java.lang.String" value="+12028164833" />
    
  3. Save and close the configuration file.

  4. Restart the Tomcat server.

In the previous snippet—

  • Line 2 specifies the default text messaging configuration as twilio.
  • Line 3 specifies the fully qualified class name implementing the text messaging service.
  • Lines 4–5 include values for the API’s account ID and token that you acquired in Step 1: Acquire SMS API Credentials.
  • Line 6 specifies the default from number that appears in the recipient’s text message. This number must be one that the SMS service recognizes as authorized to send text messages, and is the same one you created in Step 2: Provision From Numbers.

Step 4: Configure Text Message Delivery

In this step, you configure Brightspot to send text messages through Twilio. The following illustration is an example of a typical text message. Contact your Brightspot developer to customize the message’s wording for your organization’s needs.

../../../_images/sms-delivery-option.png
  1. In the Brightspot header, click Profile. The Profile panel appears.

  2. Under the Notifications tab, under Delivery Options, click Add Text (SMS). A form appears.

    ../../../_images/sms-unconfirmed.png
  3. In the Phone Number field, enter your phone number. (You can configure a default phone number for all text delivery options; for details, see Viewing and Modifying Your Profile.)

  4. Click Save.

  5. Re-open the profile settings: in the Brightspot header, click Profile.

  6. Under the Notifications tab, under Delivery Options, check for a message that the delivery option needs to be verified.

  7. Click Click here to confirm. Brightspot sends a confirmation message to your phone.

  8. In your phone’s messaging app, check for a message from Brightspot that includes a verification code.

  9. In the Code field, enter the verification code.

    ../../../_images/sms-confirmation.png
  10. Click Submit.

See also:

Notifications