Subscribers

Use the Subscribers API to manage subscriptions. With this API, you can programmatically subscribe and unsubscribe users from subscriptions.

Subscribe user

Make a call to this endpoint to opt-in a user to a subscription. Note that when a user is opted-in programmatically, it must include compliant legal language. For transactional messages, you must include a transactional opt-in unit. By default, if a subscription already exists, it will try and record the attempt to create the subscription again. For TEXT subscriptions, this will result in a message being sent to the person indicating that they are already subscribed.

Authorizations:
OAuthFlow (subscriptions:write)
Request Body schema: application/json
required
object (UserDto)

User associated with the action. Note that this is a visitor to the site and does not need to be actively subscribed to Attentive.

signUpSourceId
required
string

The unique identifier of the sign-up source. This can be found in the Subscribers tab of the Attentive platform in the ID column for any API sign-up method.

Or, you can contact our White Glove team (whiteglove@attentivemobile.com) or your Client Strategy Manager at Attentive to request a sign-up source for either marketing or transactional opt-ins. Our team will verify that you implemented the endpoint with compliant legal disclosure language.

Responses

Request samples

Content type
application/json
{
  • "user": {
    },
  • "signUpSourceId": "string"
}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "subscriptionResponses": [
    ]
}

Get subscription eligibility for a user

Make a call to this endpoint to list all subscription types and channels a user is subscribed to. You can query for a subscriber using either their phone number or email. One of the query parameters is required in order to look up a subscriber. As an example, you can use this endpoint to check if a subscriber is eligible to receive SMS or email campaigns, and then send them a message based on that eligibility.

Authorizations:
OAuthFlow (subscriptions:write)
query Parameters
phone
string
Example: phone=+13115552368

A user's phone number we use to fetch subscription eligibility.

email
string
Example: email=test@gmail.com

A user's email we use to fetch subscription eligibility.

Responses

Request samples

curl -i -X GET \
  'https://api.attentivemobile.com/v1/subscriptions?phone=%2B13115552368&email=test%40gmail.com' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Response samples

Content type
application/json
{
  • "subscriptionEligibilities": [
    ]
}

Unsubscribe subscriptions for a user

Make a call to this endpoint to unsubscribe a user from a subscription type or channel. If no subscriptions are present in the request, the user is unsubscribed from all subscriptions. If subscriptions are present in the request, the user is unsubscribed from the requested type or channel combination. By default, if a subscription exists, but the user is already unsubscribed, it records the attempt to unsubscribe the subscription again. For TEXT subscriptions, a message is sent to the person indicating that they are unsubscribed.

For the user object, the email data point determines which email subscriptions a user has and the phone data point determines which text (or sms) subscriptions a user has. Passing in an email does not locate, nor unsubscribe, a user from any sms subscriptions. Similarly, passing in a phone does not locate, nor unsubscribe, a user from any email subscriptions.

Authorizations:
OAuthFlow (subscriptions:write)
Request Body schema: application/json
required
object (UserDto)

User associated with the action. Note that this is a visitor to the site and does not need to be actively subscribed to Attentive.

Array of objects (SubscriptionDto)

Responses

Request samples

Content type
application/json
{
  • "user": {
    },
  • "subscriptions": [
    ]
}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "subscriptionResponses": [
    ]
}