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.

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

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 a user in the Attentive platform, 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
Access Token

Exchange a temporary authorization code (generated during app installation) for an access token using the OAuth authorization code grant flow.

This token is used to authenticate, grant, and control permissions for your application when making API calls.

Authenticating public applications to use Attentive’s API resources.

Enabling third-party apps to access Attentive APIs on behalf of users.

eCommerce API Use the eCommerce API to 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 (beta) 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.

Note: This data cannot contain any sensitive or special categories of information as defined in applicable data protection and privacy laws, including the California Consumer Privacy Act (CCPA) and California Privacy Rights Act (CPRA). See a list of specific categories of data you cannot share with Attentive here.

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.

Note: This data cannot contain any sensitive or special categories of information as defined in applicable data protection and privacy laws, including the California Consumer Privacy Act (CCPA) and California Privacy Rights Act (CPRA). See a list of specific categories of data you cannot share with Attentive here.

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.

Notes:
  • A legal disclosure is required when a user is opted-in programmatically.
  • If you're using the Subscribers API, please contact your CSM or our Support team here to retrieve the signUpSourceID necessary to complete your API call and to confirm final implementation of your Subscribers API. See Subscribers for more information.
 
Webhooks API Create and manage webhooks.

Receive real-time notifications for events such as sms.subscribed, sms.sent, email.opened, custom_attribute.set, and more.

See Webhooks for a full list of events.

Product Catalog API Enables sending high-performing journeys such as back in stock, low inventory, and price drop. It also lets you segment your customers and branch journeys using product data.

Enable high-performing journeys (e.g., back in stock, low inventory, price drop), segment customers based on their product interaction activity, and branch journeys using product data such as name, category, or price.

See Product Catalog for detailed file format and implementation instructions.

Privacy Request API Use the Privacy Request API in order to comply with California Consumer Privacy Act (CCPA) deletion requests through Attentive. Programmatically submit user data deletion requests and check the status of these requests.
Identity API (beta) Manage user identifiers. With this API, you can programmatically add a client user identifier or custom identifier(s) to a user. Associate various identifiers (e.g., client user ID, custom IDs) with a user's phone, email, Shopify ID, or Klaviyo ID to build a unified user profile.

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 using the Attentive API testing console. This is a browser-based tool that offers a seamless environment for testing and validating your API requests. You can also subscribe to your Attentive messaging program with your own phone number and make 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