Subscribers

Make a call to this endpoint to opt-in a user to a subscription.

Notes:

  • A legal disclosure is required when a user is opted-in programmatically.

  • 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.

  • Requests to opt-in subscribers must either contain a) a sign-up source id or b) both a locale and a subscription type.

    • The unique identifier of a sign-up source can be found in the Sign-up Units tab of the Attentive platform in the ID column. If this value is provided in the request, then this sign-up unit will be used for opting in the user in the request.

    • Callers of this endpoint have the option to omit signUpSourceId and, instead, provide both a locale and a subscriptionType (see below for field details). Given the locale and subscription type, Attentive will resolve any matching API opt-in units. To opt-in a user to a subscription without a signUpSourceId and exclusively based on locale and subscription type, there must be exactly one API sign-up unit that matches the provided locale and subscription type. Conversely, requests that contain a locale and a subscription type that do not have a corresponding sign-up unit or that have multiple matching sign-up units will receive a 400 response and will not opt a user into a subscription.

  • For users in either France or Italy, in accordance with compliance updates documented here, we set an email pixel tracking consent attribute as part of opting in an email subscriber. This is set by default when the locale of a subscriber is in France or Italy. We expose the capability in this endpoint to set this consent on behalf of the user via the pixelTrackingConsent parameter. This is a boolean parameter which when provided indicates whether or not a subscriber has consented to email pixel tracking. When this endpoint is called with pixelTrackingConsent = true and an email on the UserDto, the email subscription will be created with that tracking consent, visible in subscriber attributes. If it is not passed in at all the consent defaults to false. NOTE: This parameter will only be honored if it is passed in with a signUpSourceId, otherwise we will not save the attribute.

  • Phone numbers must be submitted in e164 format.

    • valid examples: +19148440001, +442071838750, +551155256325
    • invalid examples: 19148440001, +1---914---844---0001, 1 () 914 844 0001
post/subscriptions

Request

  • Base URL
    https://api.attentivemobile.com/v1
  • Auth
    OAuth 2
    Authorization code: https://ui-devel.attentivemobile.com/integrations/oauth-install?client_id={clientId}&redirect_uri={redirectUri}&scope={scope}
    Token URL: https://api.attentivemobile.com/v1/authorization-codes/tokens scopes: subscriptions:write

Request body

signUpSourceIdstring

The unique identifier of the sign-up source. This can be found in the Sign-up Units tab of the Attentive platform in the ID column for any API sign-up method. This field is required if locale is not present.

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 review API opt-in units with compliance in mind.

subscriptionType'MARKETING' | 'TRANSACTIONAL'
singleOptInboolean

Opt in subscriber silently (do not send a Reply Y to subscribe text).

NOTE: This property is disabled (set to false) by default. We strongly recommend maintaining the standard double opt-in flow, as it serves important legal and compliance purposes. If you want to enable single opt-in, we encourage you to speak with your dedicated Client Strategy Manager (CSM) or our White Glove team (whiteglove@attentivemobile.com) before you enable it. If this property is set to true, subscribers will be added without receiving the initial “Reply Y” confirmation text message. This setting bypasses only the “Reply Y” message. The mandatory legal message will still be sent.

pixelTrackingConsentboolean

Explicitly set subscriber pixel tracking consent. This is implemented in accordance with compliance requirements in France and Italy. French and Italian subscribers have to explicitly opt in to email pixel tracking, so this parameter allows third party developers to create a subscription with the tracking consent set.

NOTE: This property is false by default. Will only be set to true if explicitly passed in. It will also only be honored if it is passed in alongside a signupSourceId.

Example request

{
  "user": {
    "phone": "+13115552368",
    "email": "test@gmail.com"
  },
  "locale": {
    "language": "en",
    "country": "US"
  }
}

Response

Accepted a create subscription(s) request. The response body will contain info about which subscription(s) already exist, and which subscription(s) will be created (asynchronously).

Example response

{
  "user": {
    "phone": "+13115552368",
    "email": "test@gmail.com"
  }
}

Changes

    • info

      added the new optional request property

    • warning

      added the new CONTACT enum value to the /// response property for the response status