# Read Campaign Statistics

Reads what one campaign achieved -- an email or SMS newsletter, or any autoresponder (subscription, date field or birthday) in either channel: recipients, sent and failed, opens and clicks each as a total and as unique contacts, browser views, conversions, unsubscriptions, the three bounce kinds and spam complaints, plus every tracked link with its clicks, most-clicked first. Three rates come as the KlickTipp dashboard computes them: openRate over what was SENT, clickRate over what was OPENED (the share of readers who clicked), clickRateOfRecipients over the sends. Do not divide the counters yourself. An SMS campaign has no opens, so opensTotal, opensUnique, openRate, clickRate and browser views are null -- use clickRateOfRecipients. Totals are lifetime and not restricted to a period. A campaign that has not gone out answers with zeroes. For an automation use get-automation-statistics.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "campaignId": {
      "type": "integer",
      "description": "ID of the campaign whose statistics are read",
      "minimum": 1
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account the access token works in",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "campaignId"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "campaignId",
    "name",
    "campaignType",
    "channel",
    "campaignStatus",
    "recipients",
    "sent",
    "failed",
    "opensTotal",
    "opensUnique",
    "openRate",
    "clicksTotal",
    "clicksUnique",
    "clickRate",
    "clickRateOfRecipients",
    "browserViewsTotal",
    "browserViewsUnique",
    "conversionsTotal",
    "conversionsUnique",
    "unsubscriptions",
    "hardBounces",
    "softBounces",
    "spamBounces",
    "spamComplaints",
    "links",
    "statisticsUrl"
  ],
  "properties": {
    "campaignId": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "campaignType": {
      "type": "string"
    },
    "channel": {
      "type": "string",
      "enum": [
        "email",
        "sms"
      ]
    },
    "campaignStatus": {
      "type": "string"
    },
    "recipients": {
      "type": "integer"
    },
    "sent": {
      "type": "integer"
    },
    "failed": {
      "type": "integer"
    },
    "opensTotal": {
      "type": [
        "integer",
        "null"
      ]
    },
    "opensUnique": {
      "type": [
        "integer",
        "null"
      ]
    },
    "openRate": {
      "type": [
        "number",
        "null"
      ]
    },
    "clicksTotal": {
      "type": "integer"
    },
    "clicksUnique": {
      "type": "integer"
    },
    "clickRate": {
      "type": [
        "number",
        "null"
      ]
    },
    "clickRateOfRecipients": {
      "type": "number"
    },
    "browserViewsTotal": {
      "type": [
        "integer",
        "null"
      ]
    },
    "browserViewsUnique": {
      "type": [
        "integer",
        "null"
      ]
    },
    "conversionsTotal": {
      "type": "integer"
    },
    "conversionsUnique": {
      "type": "integer"
    },
    "unsubscriptions": {
      "type": "integer"
    },
    "hardBounces": {
      "type": "integer"
    },
    "softBounces": {
      "type": "integer"
    },
    "spamBounces": {
      "type": "integer"
    },
    "spamComplaints": {
      "type": "integer"
    },
    "links": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "url",
          "title",
          "clicksTotal",
          "clicksUnique"
        ],
        "properties": {
          "url": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "clicksTotal": {
            "type": "integer"
          },
          "clicksUnique": {
            "type": "integer"
          }
        }
      }
    },
    "statisticsUrl": {
      "type": "string"
    }
  }
}
```

