# Read Split Test Results

Reads what a split test found out: every arm with its label ("A", "B"), its email, and how many contacts opened, clicked and converted, plus the revenue attributed to it. winnerBy names the criterion the test is decided by. The winner is reported, never computed: while the measuring period runs, isDecided is false and winnerLabel is null -- the arm that happens to lead is not the winner, and calling it early is how a test gets decided before it has said anything. A campaign that is not a split test is refused rather than answered with an empty result. The test's configuration and its arms are get-newsletter-split-test; one newsletter as a whole is get-campaign-statistics.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "newsletterId": {
      "type": "integer",
      "description": "ID of the split-test newsletter, as get-newsletter reports it",
      "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": [
    "newsletterId"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "newsletterId",
    "hasStarted",
    "isDecided",
    "winnerBy",
    "winnerLabel",
    "variants"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "newsletterId": {
      "type": "integer"
    },
    "hasStarted": {
      "type": "boolean"
    },
    "isDecided": {
      "type": "boolean"
    },
    "winnerBy": {
      "type": [
        "string",
        "null"
      ]
    },
    "winnerLabel": {
      "type": [
        "string",
        "null"
      ]
    },
    "variants": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "label",
          "emailId",
          "name",
          "opened",
          "clicked",
          "converted",
          "revenue",
          "isWinner"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "emailId": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "opened": {
            "type": "integer"
          },
          "clicked": {
            "type": "integer"
          },
          "converted": {
            "type": "integer"
          },
          "revenue": {
            "type": "number"
          },
          "isWinner": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
```

