Remove subscribers
You can use the Subscribers API to remove (opt-out) subscribers from your Attentive list. After you remove a user, a final message is sent to confirm that the user is unsubscribed and will no longer receive messages. Note that this action does not delete users from the system in case they choose to opt-in later at a future date.
Note the following:
- If you aren't already using this legacy API, it is recommended that you use the Subscribers API.
- Legacy APIs and the APIs outlined in the Attentive API section need separate tokens. Contact legacyapi@attentivemobile.com for a legacy API token.
URL
POST https://api.attentivemobile.com/1/subscribers/unsubscribe
Headers
Header name | Description | Value | Required |
Authorization | You must provide an access token. Contact legacyapi@attentivemobile.com for this token. | Bearer <token>
|
Required |
Content-type | The format of returned data. | application/json
|
Required |
Parameters
Parameter | Description | Example | Type | Required | Notes |
phone
|
Phone number of a subscriber. | 555-555-5555
|
string | Required | |
sendOptOutMessage
|
If set to true , the user is removed from the list and will receive a text message informing them that they are now unsubscribed. It is recommended to set to true , as it provides a better user experience.
If set to |
true
|
boolean | Required |
Sample JSON request
curl 'https://api.attentivemobile.com/1/subscribers/unsubscribe' \
-X POST \
-H 'Authorization: Bearer 1a2b3c4d5' \
-H 'Content-Type: application/json' \
-d '{"phone": "555-555-5555","sendOptOutMessage":"true"}' \
-v
Status codes
The following table lists the returned HTTP status codes.
Code | Description | Notes |
200 | OK | Request successful, the subscriber successfully opted out. |
400 | Bad request | Data is improperly formatted or no subscriber exists. |
401 | Authorization error | API key is incorrect. |
409 | Subscriber already opted out | n/a |
500 | Attentive server-side error | n/a |