> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myunite.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Results

> How to read the status, score, pillars, findings and PDF of a pre-test.

Read a pre-test with `GET /pretests/{id}`.

## Status

| Status | Meaning |
| - | - |
| `queued` | Accepted and waiting to start. |
| `processing` | Being analyzed. |
| `completed` | Result available in `result`. |
| `failed` | Not completed. See `error`. |

`result` is only filled when the status is `completed`. `error` is only present when it is `failed`.

## Score and recommendation

* `result.score`: overall score from 0 to 10. Can be `null`.
* `result.recommendation`: `launch`, `optimize` or `iterate`, from most favorable to the one that needs the most work. Can be `null`.
* `result.recommendationLabel`: the same text, ready to display, in the language of the result.
* `result.conclusion`: conclusion paragraph.

## Pillars

`result.pillars` is an object with a score from 0 to 10 for each evaluation pillar. The pillars vary by channel, so read the keys that come back instead of assuming a fixed list.

## Findings

`result.findings` lists the checks made on the piece. Each item has:

| Field | Description |
| - | - |
| `check` | Stable identifier of the check. |
| `name` | Name to display. |
| `category` | Group of the check. |
| `status` | `pass`, `warn`, `fail`, `info` or `pending`. |
| `score` | Score from 0 to 10, or `null`. |
| `summary` | Short explanation, or `null`. |
| `optional` | `true` if the check is optional. |

## Recommendations and maps

* `result.recommendations`: suggested actions, each with `title`, `description`, `priority` (`high`, `medium` or `low`) and `category`.
* `result.maps`: `heatmap`, `contrast` and `focus`, each `null` or with `url` and `mediaType` (`image/jpeg` or `video/mp4`).

## Analysis PDF

The pre-test `report.status` shows the state of the PDF: `pending`, `generating`, `ready`, `failed` or `unavailable`. It stays `pending` until the PDF is generated. For OOH and digital, the PDF is usually generated on its own after the analysis finishes. For email, it is only generated when you ask for it. `GET /pretests/{id}/report` starts generation for any `completed` pre-test and returns the link when it is ready:

| Response | What to do |
| - | - |
| `200` with `status: "ready"` | Download the PDF from `url`. Fetch the link when you need the file and do not count on the URL staying the same. |
| `202` with `status: "generating"` | Wait the `Retry-After` time and check again. |
| `409` [`report_not_ready`](https://docs.myunite.ai/en/errors#report_not_ready) | The pre-test is not `completed` yet. |

```bash curl theme={null}
curl https://myunite.ai/api/v1/pretests/PRETEST_ID \
  -H "Authorization: Bearer $UNITE_API_KEY"
```

```javascript JavaScript theme={null}
const res = await fetch("https://myunite.ai/api/v1/pretests/PRETEST_ID", {
  headers: { Authorization: `Bearer ${process.env.UNITE_API_KEY}` },
});
const p = await res.json();
if (p.status === "completed") {
  console.log(p.result.score, p.result.recommendationLabel);
  for (const f of p.result.findings.filter((f) => f.status === "fail")) {
    console.log(f.name, f.summary);
  }
} else if (p.status === "failed") {
  console.log("Failed:", p.error.code);
}
```

```python Python theme={null}
import os
import requests

p = requests.get(
    "https://myunite.ai/api/v1/pretests/PRETEST_ID",
    headers={"Authorization": f"Bearer {os.environ['UNITE_API_KEY']}"},
).json()
if p["status"] == "completed":
    print(p["result"]["score"], p["result"]["recommendationLabel"])
    for f in p["result"]["findings"]:
        if f["status"] == "fail":
            print(f["name"], f["summary"])
elif p["status"] == "failed":
    print("Failed:", p["error"]["code"])
```

## When it fails

A `failed` pre-test carries `error.code`:

| Code | Meaning |
| - | - |
| `video_too_long` | The video is longer than 30 seconds. |
| `quota_exhausted` | The pre-test quota is used up. |
| `dispatch_failed` | The analysis could not be started. If it stays stuck before starting for 2 hours, the pre-test fails with this code and the quota unit is returned. |
| `processing_failed` | The analysis could not be completed. |

These codes appear in the pre-test's `error.code`. Call errors (HTTP 4xx and 5xx) are in [Errors](https://docs.myunite.ai/en/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.