Attentive's APIs

Attentive’s APIs allow you to send customer data to Attentive to further personalize your SMS strategy to drive more revenue per message. Our APIs can enable use cases such as transactional messaging, email orchestration, loyalty messaging, and much more.

This guide is intended for software developers or IT professionals responsible for integrating and using Attentive’s APIs within their own applications or platforms.

Table of contents

Step 1: Create a custom app

A custom app is required to generate an API key in order to use any of our APIs.

Create a custom app in the Attentive platform in the App Marketplace by clicking + Create App in the top-right corner.

Use the /me endpoint to test that you are authenticating correctly.

Keep your API key secure. If it’s accidentally shared, other users may be able to send messages to customers on your behalf.

Step 2: Implement Attentive APIs

To associate data from an Attentive API with an Attentive user, a phone number or email address is required. The phone number doesn't need to be an active SMS subscriber at the time the API call is made. If you send data associated with a phone number that’s associated with an SMS subscriber at a future date, Attentive automatically associates all historical data you have sent with that user.

Attentive supports a number of APIs that enable you to send data to Attentive:

Attentive's API Description Example use cases
eCommerce API Trigger an event when a user views a product, adds a product to their shopping cart, or makes a purchase.

Mobile app tracking and purchase attribution

In-store purchase attribution

Offers API Add discount codes to an existing offer.

Replenish a set of unique discount codes

Custom Events API Trigger a custom event when a user performs an action that you’d like to use for targeting within Attentive segments or journeys.

Transactional order updates

Transactional subscription updates

Loyalty updates

Email orchestration

On-site events (e.g., added to wishlist)

Custom Attribute API Create and update custom user attributes for use in Attentive’s segment builder.

Loyalty Tier, Gender, Birthday, Estimated LTV, etc.

Subscribers API Capture SMS transactional and marketing opt-ins through third-party sign-up sources (e.g., checkout). Our team reviews all draft API opt-in units and provides recommendations prior

The Attentive API documentation site provides comprehensive documentation for each of our APIs.

Note: If you're using the Subscribers API, please contact your CSM or White Glove (whiteglove@attentivemobile.com) to retrieve the signUpSourceID necessary to complete your API call and to confirm final implementation of your Subscribers API. See Subscribers for more information.

Step 3: Set up journeys

Data sent from the eCommerce API or Custom Events API is available as a trigger in Attentive journeys.

  1. Go to Journeys.
  2. Click + Create journey.
  3. Click Start from scratch.
  4. Search for and select the trigger you want to use to start the journey.
  5. Click Continue.
  6. Choose whether the journey is marketing or transactional.
  7. Click Get started.
  8. Build and schedule your new journey.

Step 4: Test implementation of Attentive APIs

To test that Attentive APIs are working as expected, we recommend subscribing to your Attentive messaging program with your own phone number and making an API call using that phone number.

Attentive API How to test
eCommerce API
  1. Set up a Browse Abandonment (product view), Cart Abandonment (add to cart), or Post Purchase (purchase) journey. See Create a journey for more information.
  2. Send a product view, add to cart, or purchase event with your phone number using the eCommerce API.
  3. Confirm you receive the relevant messages for that journey.
Custom Events API
  1. Set up a journey with a chosen custom event type. See Create a custom journey for more information.
  2. Send the custom event with your phone number using the Custom Events API.
  3. Confirm you receive the relevant messages for that journey.
Subscribers API
  1. Set up a new welcome journey or connect your API to an existing welcome journey.
  2. If you’re already subscribed, opt out of your Attentive SMS program via text message.
  3. Use the Subscribers API to subscribe using your phone number.
  4. Confirm that you're now a subscriber.
Custom Attributes API
  1. Set attributes for your phone number using the Custom Attributes API.
  2. Create a segment using those custom attributes.
  3. Confirm that you're included in the segment.

(Optional) Step 5: Set up segments

Any data sent from the eCommerce API, Custom Events API, or Custom Attributes API is available as an option under Custom Attribute or Custom Event in Attentive’s segment builder:

  1. Go to Segments.
  2. Click + Create Segment.
  3. Choose Dynamic segment.
  4. From the Choose condition dropdown, click A subscriber’s characteristics.
  5. Search for and select the data you want to use to segment subscribers. Depending on the data, enter a value or select from a dropdown of possible values.

Finish building your segment. For more information, see What is segmentation?

Articles in this section

Was this article helpful?
1 out of 3 found this helpful