Attentive Integration with Lifecycle Optimizer Webhooks

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

Best Practice: Connecting your 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.

Create a new app in Attentive

In order to use Attentive's APIs, you must create a new app in Attentive. Follow these steps to create an API key with which you can send and retrieve data.
  1. On the App Marketplace page, click + Create app.
  2. In the App name field, enter an internal-facing name.
  3. Add a Contact email so that Attentive can reach out to you if there are issues.
  4. In the Permissions section, select Write next to each API that you would like to allow access to.
  5. Click Create and your API key will appear.
  6. Important: Click Copy to save the API key. You will need this API key to give your Lifecycle Optimizer flow permission to call the Attentive API.

Legacy API Users

For Attentive Legacy API users, reach out to an Attentive Support representative to find your API key.
Once the custom app has been created, you will be able to use any of the Attentive APIs that you've enabled permissions for.

Send a message using the Messages API with Lifecycle Optimizer Webhooks

The Messages API can be used to send SMS and MMS messages to any profile with a stored 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 via the User API. That process is outside the scope of this document, but verifying that phone number is being passed upon capture is a crucial part of enabling this integration. No messages will be sent if phone numbers are not being passed.

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: https://api.attentivemobile.com/v1/text/send

    Legacy API Users

    For Attentive Legacy API users, reach out to an Attentive Support representative to find your API key.
  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 Description Type Required Notes
    to Subscriber phone number. subscriberExternalId must be null if using this identifier. string Required* *Only required if not using subscriberExternalId Example: "+12345678901"
    subscriberExternalId Attentive's subscriber external ID. to must be null if using this identifier. integer <int64> Required* *Only required if not using to dynamically generate this ID, this data must be pulled into the system
    subscriptionType Type of subscriber who will receive the message. Either MARKETING or TRANSACTIONAL. string Required
    body The body of the MMS/SMS message. If it contains fully qualified links (such as http://www.google.com), they are shortened if useShortLinks is set to true. string Required
    mediaUrl URL of the image that accompanies MMS. string Optional
    useShortLinks Automatically shorten links provided in the body. Requires a non-null messageName. boolean Required
    messageName Name of the message to be created for tracking purposes. Restricted to 20 messages in a 24 hour window per company. string Optional
    skipFatigue Default: true Forces a message send to a fatigued subscriber. Applicable to all subscription types. boolean Required
    Example payload:
    {
    "to": "{profile.keys.sms}",
    "body": "Test Message",
    "subscriptionType": "MARKETING",
    "useShortLinks": false,
    "skipFatigue": false
    }
    

    Legacy API Users

    For Attentive Legacy API users, reach out to an Attentive Support representative to find your API key.
  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 Webhook Call

Zephyr is Engage by 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}",
"subscriptionType": "MARKETING",
"useShortLinks": false,
"skipFatigue": false
}

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}",
"subscriptionType": "MARKETING",
"useShortLinks": false,
"skipFatigue": false
}

Subscribers API

The Add Subscribers API allows you to capture a user's phone number and send that subscriber to Attentive to be synced into the Attentive database. There are different ways in which you 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, a Lifecycle Optimizer flow must be triggered. By using Attentive's Subscribers API, you can send a webhook to Attentive to register the user into your Attentive account.

Contact us

Top