Overview
Use the Unsubscribe API to unsubscribe an email address from receiving future communications.
Related APIs:
- Use the Subscriber Service API to create a subscriber record in Aimbase and add to a list to send nurture or email campaigns.
- Use the Subscriber Optin API to filter, sort and retrieve subscriber's email status and optin information to keep another system in sync.
Possible Response Codes
- 200 (OK).This response indicates that the prospect was successful unsubscribed from the indicated brand(s).
- 400 (Bad Request). This response indicates that there was an issue with the request, such as missing headers or invalid JSON. Along with the 400 response, the body of the response will contain an error message describing why the request failed.
- 500 (Internal Server Error). This response indicates that an unexpected condition occurred on the server, and it was unable to fulfill the request.
Authentication
The Unsubscribe API requires authentication. The HTTP POST will require a valid Authenticate message header with an API token. See the Aimbase Authentication Web Service Specification for more details on how to retrieve a valid API token.
Authenticate message header example:
Authenticate: Avala-Api {username}:{token}
Post Information
HTTP Endpoint
https://{baseurl}/Email/api/Unsubscribe?manufacturer={manufacturerCode}
Data Schema
Field Name | Required | Description |
EmailAddress | Email address that will be unsubscribed. | |
SendSubscriberUid | Passing the SendSubscriberUid allows for attributing the unsubscribe to a specific email that the prospect received. | |
BrandCodes | Brands that prospect will be unsubscribed from. If no brand code is passed, prospect will be unsubscribed from all brands within the manufacturer sent in the URL. Use a comma separated string if passing more than one brand. |
JSON Example Post
POST: https://{baseurl}/Email/api/Unsubscribe?manufacturer={manufacturerCode} Host: {baseurl} Authenticate: Avala-Api {username}:{token} Content-Type: application/json [
{
"EmailAddress": "john.smith@rollick.io",
"SendSubscriberUid": "adf6c7fa-fc78-4a5f-8824-b0dc44015154",
"BrandCodes": "GA, BD, TM"
}
]
Sample Success Response
HTTP/1.1 200 OK
Sample Failed Responses
HTTP/1.1 400 Bad Request
{
"Message": "The request is invalid.",
"ModelState": {
"unsubscribes[0].SendSubscriberUid":[
"An error has occurred."
]
}
}
HTTP/1.1 500 Internal Server Error
{
"Message": "An error has occurred."
}