GET subscribers/{id}/subscriptions

Overview

GET /v2/subscribers/{id}/subscriptions returns the division names, subscribed status information, and subscription events for an existing specified customerDefinedID + Api-User.

The response payload consists of three collections:

  • "memberOf" lists the divisions to which the subscriber is currently subscribed;
  • "current" lists all divisions, and provides the subscriber's current subscription status to each divsion;
  • "events" provides the history of all subscription events for the subscriber.

Resource URI

GET https://api.yesmail.com/v2/subscribers/{id}/subscriptions

Call Description

The GET /v2/subscribers/{id}/subscriptions call returns the division names, subscribed status information, and subscription events for an existing specified customerDefinedID + Api-User.

HTTP Return Codes

Code

Description

200 OK

The request has succeeded.

401 Unauthorized

The request requires user authentication.  Invalid Api-User and/or Api-Key header value.

404 Not Found

The server has not found anything matching the request resource.   For instance, the “id” or subscription does not exist.

 


Response Payload: 
{
                              ;”referred” = true or “dead” = true would go here, if applicable
    "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-01-10T08:09:10Z"
        }
    ],
    "events": [
        {
            "division": "Division1",
            "state": "subscribed",
            "time": "2013-01-01T08:09:10Z"
        },
        {
            "division": "Division3",
            "state": "subscribed",
            "time": "2013-01-02T08:09:10Z"
        },
        {
            "division": "Division2",
            "state": "subscribed",
            "time": "2013-01-04T08:09:10Z"
        },
        {
            "division": "Division3",
            "state": "unsubscribed",
            "time": "2013-01-10T08:09:10Z"
        }
    ]
}