Attentive Integration

Create personalized mobile messaging in Lifecycle Optimizer with Attentive. With this integration, you can send both SMS and MMS messages to your users.

There are currently 3 Attentive APIs accessible through Lifecycle Optimizer:

  • The Messages API
  • The Bulk Messages API
  • The Add Subscribers API

Best Practice: Connecting your Sailthru account with a third party vendor requires a 3rd party API Key and Secret. For your account security, you should use a different Key and Secret for each integration. Contact support to request an integration-specific Key and Secret.

Messages API

The Messages API can be used to send SMS and MMS messages to any profile in Sailthru with a phone number stored on their profile.

Note that Sailthru is not normally responsible for capturing phone number. In most circumstances, Attentive should be responsible for capturing a user’s phone number, associating it with an email address, and passing that data to Sailthru via the Sailthru User API. That process is outside the scope of this document, but verifying that phone number is being passed to Sailthru upon capture is a crucial part of enabling this integration. No messages will be sent if phone numbers are not being passed to Sailthru.

In order to leverage Lifecycle Optimizer to send a mobile message, follow these steps:

  1. Navigate to Lifecycle Optimizer from the Messaging menu in the Automation section.
  2. Select an existing Lifecycle Optimizer flow or create a new one.
  3. Add an Action to your flow.
  4. In your Lifecycle Optimizer flow, select Send Webhook under the Actions dropdown menu:
    The Lifecycle Optimizer interface for setting a webhook. Shows the Send Webhook Action highlighted.
  5. In the URL input, enter the URL for the Attentive Messages API:
  6. Leave selected Method as POST and Content as JSON in the dropdowns:
  7. In the payload, enter the JSON of the message. Fields are as follows:
    Parameter Type Required (y/n) Description Example
    to string y Phone number of user


    • Format is XXX-XXX-XXXX
    • Attentive currently only supports U.S. numbers
    • To dynamically send to a user, use this Zephyr statement to pull in a user’s phone number: "{profile.keys.sms}"
    body string y Body of SMS/MMS message


    • Attentive automatically prepends the customer’s name to all outgoing messages
    • Keep body length under 160 characters where possible
    • If you’re including a URL, it should be sent with the body
    30% off sitewide sale going on now. Use code SAVE30.

    Your order of XYZ Widgets has been placed for $49.99. You will receive another text alert when your order ships.

    Customer Service
    Hi John, I’m sorry to hear you’re having a problem with your XYZ Widgets order. We refunded your order. Let me know if I can be of further assistance.

    Type string y Message Type (there is only a single type allowed currently) TRANSACTIONAL
    mediaUrl string n URL of image that would accompany text message (optional)

    • Messages sent with a mediaUrl will automatically be converted to MMS
    • Supported file types are .gif, .png and .jpg
    • Media size must be under 500KB otherwise we will not accept the message
    notificationUrl string n Customer callback URL. Attentive will fire callback to your endpoint when messages are processed (optional)

    Example payload:

    "to" : "{profile.keys.sms}",
    "body" : "Thanks for subscribing!",
    "type" : "TRANSACTIONAL",
    "mediaUrl" : "",
    "notificationUrl" : ""
  8. Enter your Bearer token under Headers. Enter Authorization (capitalized) as the key and your token preceded by Bearer as the value:
  9. Activate your flow once you’ve completed setting up your customer journey and you’re ready to start sending omnichannel messages!

Use Zephyr with Attentive

Zephyr is Sailthru’s native templating logic. Using Zephyr, you can include data such as profile information or content recommendations. To do so, change the Content-Type to “Other”:

You can then enter your Zephyr data before the payload, like so:

Profile Data

{body = "Hi, " + profile.vars.first_name + " !"}

"to" : "{profile.keys.sms}",
"body" : "{body}",

Content Recommendations

{content = personalize({
"algorithm" : "trending",
"size" : 1

{body = "Picked for you! " + content[0].title}
{mediaUrl = content[0].image}
"to" : "{profile.keys.sms}",
"body" : "{body}",
"mediaUrl" : "{mediaUrl}"

Add Subscribers API

The Add Subscribers API allows you to capture a user’s phone number through Sailthru, and send that subscriber to Attentive to be synced into the Attentive database. There are different ways in which Sailthru can capture a phone number, including:

  • Our Overlays signup form product
  • Our Javascript (front end) API
  • Our back end API
  • Our Hosted Pages which can be used to build preference centers and signup forms

Once the number has been captured by Sailthru, a Lifecycle Optimizer flow must be triggered, which then sends a Webhook to Attentive to register the user in Attentive.