POST reports/master-events

Overview

This method creates a request for a master based event report. In this request you can specify a master, a date range and the events you want to report on. The report will always return the summary statistics (KPIs) for a master. If you include no parameters besides the template id, the report will return only the KPIs for the last seven days.

Resource URI

 https://api.yesmail.com/v2/reports/master-events

Call Description

The POST /v2/reports/master-events call requests a message based event report.

HTTP Return Codes

Code

Description

200 OK

Returned when the master ID exists and the JSON payload is valid.

400 Bad Request

Returned when the payload is malformed or has invalid property names or values.

401 Unauthorized

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

404 Not Found The Master ID cannot be found. May not exist for the given api-user or may be archived.

Request

This request will return all detailed events for a 30 day period

{
  "filters": {
    "masterId": "123456",
    "opens": true,
    "clicks": true,
    "unsubscribes": true,
    "bounces": true,
    "period": "2014-05-12T00:00:00-05:00/2014-06-12T00:00:00-05:00"
  }
}

Response

{
  "id": "654321",
  "state": "accepted",
  "message": "Event report for master '123456' accepted.",
  "lastUpdate": "2014-04-30T17:32:01Z",
  "events": [
    {
      "state": "accepted",
      "message": "Event report request for master '123456' accepted.",
      "time": "2014-04-30T17:32:01Z"
    }
  ],
  "request" : {
    "id": "1234-4321-567890-098765",
    "user": "db-username",
    "time": "2014-04-30T17:32:00Z",
    "uri": "https://api.yesmail.com/v2/emails/test"
  },
  "response": {
    "location": "https://api.yesmail.com/v2/reports/master-events/abcdef-5432-ghij-876543"
  }
}

Request

Summary report good for just getting metrics.

{
  "filters": {
    "masterId": "123456"
  }
}

Response

Response with http callback parameters

{
  "id": "654321",
  "state": "accepted",
  "message": "Event report for master '123456' accepted.",
  "lastUpdate": "2014-04-30T17:32:01Z",
  "events": [
    {
      "state": "accepted",
      "message": "Event report request for master '123456' accepted.",
      "time": "2014-04-30T17:32:01Z"
    }
  ],
  "request" : {
    "id": "1234-4321-567890-098765",
    "user": "db-username",
    "time": "2014-04-30T17:32:00Z",
    "uri": "https://api.yesmail.com/v2/emails/test"
  },
  "response": {
    "uri": "http://callers.domain.com/path",
    "ref": "callers-ref-value",
    "location": "https://api.yesmail.com/v2/reports/master-events/abcdef-5432-ghij-876543"
  }
}