POST subscribers/unsubscribe

Overview

The Yesmail Marketing Platform uses obfuscation to hide the email address of a subscriber in the unsubscribe link generated at message delivery. This method unsubscribes a user based on the values in that unsubscribe link. When this method is invoked it will also record an unsubscribe event for the message. The "s" value is an encrypted subscriber id and the "i" value is the message id.

 

Resource URI

POST https://api.yesmail.com/v2/subscribers/unsubscribe

Call Description

The POST /v2/subscribers/unsubscribe unsubscribes a user based on a specific message. It returns the subscribers current subscriptions and subscription history.


HTTP Return Codes

Code

Description

200 OK

The request has succeeded.

400 Bad Request

The request could not be understood by the server due to malformed syntax.  For example, incorrect parameter values; invalid s or i value.

401 Unauthorized

The request requires user authentication.  Invalid Api-User and/or Api-Key header value.
Request Payload: 
{
    "s": "1A2B3C4D5E6F",
    "i": "87654321"
}
Response Payload: 
{
    "id": "jsmith@zzz.com",
    "lastUpdate": "2013-09-13T08: 09: 10Z",
    "email": "jsmith@zzz.com",
    "subscriptions": {
        "memberOf": [
            "Division1",
            "Division2"
        ],
        "current": [
            {
                "division": "Division1",
                "state": "subscribed",
                "time": "2013-01-01T08:09:10Z"
            },
            {
                "division": "Division2",
                "state": "subscribed",
                "time": "2013-01-04T08:09:10Z"
            },
            {
                "division": "Division3",
                "state": "unsubscribed",
                "time": "2013-09-13T08:09:10Z"
            }
        ]
    }
}