Opt-In/Out Handling

Users must opt in to receive SMS messages from your Sender ID and can opt out at any time. There are two ways users can opt in or opt out of your SMS audience:

  • Mobile-Originated (MO) Message: A message originating from the mobile handset can contain a keyword that triggers an opt-in. The opt-in keyword can trigger a single or double opt-in flow.
  • External Opt In: Users can opt in to SMS messages through your app, website, or other channel. You must register these users through the API.

SMS Data Protection and Compliance

Requests to opt in or out of SMS notifications are handled by Airship. Our opt-in and opt-out database:

  • Is segregated from campaign content.
  • Is encrypted.
  • For opt-ins and opt-outs that occurred via mobile-originated messages on Airship SMS, Airship stores date/time data for those opt-ins and opt-outs for a rolling 4 years.

Mobile-Originated Opt-Ins

A mobile-originated message is a message sent from a member of your audience (originating from the mobile handset of a user) to you.

Keywords

A keyword is a word that you define to perform an action, like opt-in or audience attribution, when used in a mobile-originated message. You can apply tags to your audience based on the keywords they use, segmenting your audience to send relevant messages based on your audience’s keyword-indicated interests.

Contact Airship Sales to provision keywords and associated tag operations. Airship stores your keywords and associated tag operations. Custom keywords and tag operations for keywords are not available through the dashboard or API.

By default, users can text you any of these words to opt out of notifications: STOP, STOPALL, UNSUBSCRIBE, CANCEL, END, QUIT, ARRET. You can also add additional opt-out keywords; like opt-in keywords, specialized keywords can provide additional data about opt-out behaviors.

Mobile-originated messages are represented as events. Each event records the keywords that your audience uses and additional identifying information. You can use these events to observe opt-in and opt-out trends in Performance Analytics, or to get events directly from Real-Time Data Streaming.

Single Opt-In

Single opt-in is the process of registering users and considering them opted in when they send you a single message containing a keyword. This method does not require users to confirm that they want to opt in through a second mobile-originated (MO) message.

While a single opt-in is a simple way to register users, it may not always be an optimal opt-in method. Airship mobile-originated opt-in handling defaults to a double opt-in process. Contact Airship if you want to take advantage of a single opt-in workflow.

The response to the keyword is a confirmation text message that provides information about the text program. The message usually:

  • Confirms that the user has subscribed to an on-going text program.
  • Provides the number of messages the subscriber can expect to receive.
  • Informs the subscriber where they can obtain more information and how they can opt-out.
Example:
BrandX: Welcome to the BrandX Info and Alerts Program! Message frequency varies by use. For help, reply HELP. To end, reply, STOP. Msg&DataRatesMayApply.

Double Opt-In

Double opt-in requires a user to send you a keyword indicating that they want to receive mobile messages, and a second keyword confirming their choice:

  1. Your audience texts a keyword to trigger the opt-in process.
  2. Airship sends your audience a message requesting confirmation using a keyword.
  3. Your audience texts the confirmation keyword, opting in to your audience.

Because each message in the opt-in workflow supports unique keywords, the double opt-in method provides multiple indices to categorize users as they opt in to your audience; you can add, remove, or replace tags for any of the opt-in messages, ensuring that you precisely segment your audiences and target future messages to the right users.

Non-Mobile Single Opt-In

If users provide consent to receive text messages without a mobile-originated keyword — like through your website or app — you can register them through the API in a single step. Use the /api/channels/sms endpoint with the date-time when the user opted_in.

 Tip

It may take up to an hour before you can message new users. If you want to message a new SMS user immediately, you can register new SMS users and send a message simultaneously using the create-and-send API or the Upload Users Audience option to send your SMS message.

POST /api/channels/sms HTTP/1.1
Authorization: Basic <application authorization string>
Accept: application/vnd.urbanairship+json; version=3;
Content-type: application/json

{
    "msisdn" : "15035556789",
    "sender": "12345",
    "opted_in": "2018-02-13T11:58:59"
}

When registering your audience without a mobile keyword, it is your responsibility to obtain express written consent from users. If users have not provided sufficient consent, you should perform a double opt-in.

Non-Mobile Double Opt-In

If users provide their phone numbers and express interest in SMS messages through your website or app but do not give sufficient consent to receive SMS messages from a particular sender, you can register them through the Airship API without an opted_in value.

When you register a user through the API without an opted_in value, Airship sends them a message prompting them to opt in. The user must then respond with a valid keyword to opt in to notifications.

 Tip

Airship generates a channel_id even when you register users who have not opted in. You can add tags to these channels and associate them with named users before audience members opt in.

sequenceDiagram Participant Audience Participant You Participant Airship Audience->> You: Registers via webform/app You->> Airship: Register user through API Airship->>Airship: Creates channel ID for audience You-->> Airship: (Optional) add tags to new channel Airship->> Audience: Sends opt-in request via SMS Audience->> Airship: Texts opt-in keyword to Airship note over Audience, Airship: Your audience/channel ID is opted in and can receive messages

When registering your audience without a mobile keyword, it is your responsibility to ensure that your users understand that they are agreeing to receive SMS messages from you and provide express written consent to receive SMS messages from you.

For mobile websites, you can set up a hyperlink or a button on a page that will open up the device’s messaging app and prepopulate the long or short code and keyword for the SMS opt-in.

 Note

This feature will work on most mobile devices as well as a few desktop devices, but is not guaranteed to work on every mobile device model or operating system.

HTML Hyperlink Template:
<a href="sms://CODE?&body=KEYWORD">Click Here to Opt-In</a>
HTML Hyperlink Example:
<a href="sms://54321?&body=JOIN">Click Here to Opt-In</a>

Update Opt-in Status

If your audience opts in to messaging outside of a standard opt-in flow — through your website or app — you can update the channel’s opted_in value to add them to your messaging audience.

You can also update a channel to change its time zone and locale information.

 Note

You must know the channel_id to update a channel. You can look up a channel by msisdn and sender combination to find the channel identifier that you want to update.

Update the opted_in value for a channel
PUT /api/channels/sms/{channel_id} HTTP/1.1
Authorization: Basic <application authorization string>
Accept: application/vnd.urbanairship+json; version=3;
Content-Type: application/json

{
   "msisdn": "15035556789",
   "sender": "US:12345",
   "opted_in": "2018-02-13T11:58:59",
   "timezone": "America/Los_Angeles",
   "locale_country": "US",
"locale_language": "en"
}

Manually Trigger Keyword Interactions

You can trigger a keyword interaction on behalf of your audience, without receiving a mobile originated (MO) message, using the Airship API. You may want to do this to test your keywords or to trigger keyword interactions on behalf of your audience — including keywords that opt users in or out of your messaging audience.

For example, if a member of your audience requests to be removed from your messaging audience over the phone, you could use the following operation to opt them out. This triggers the mobile terminated message confirming that the user has been removed from your messaging audience.

Trigger a “STOP” Keyword Interaction
POST /api/sms/15035556789/keywords HTTP/1.1
Content-Type: application/json
Authorization: Basic <master authorization string>

{
   "keyword" : "stop",
   "sender_ids" : [ "US:54321", "1234"]
}