Get Exam Report
GET /v1/nextexams/reports/{exam_id}/overview
Exam overview
Pass rate, score distribution and timing over the exam's graded attempts. Scope reports:read.
Request
GET https://your-site.example/api/index.php/v1/nextexams/reports/{exam_id}/overview
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
exam_id |
integer |
path |
Yes | The exam to report on. (min 1) |
Responses
200 — The overview.
{
"data": {
"attempts": 1,
"pass_count": 1,
"pass_rate": 1.5,
"mean": 1.5,
"median": 1.5,
"min": 1.5,
"max": 1.5,
"stddev": 1.5,
"avg_seconds": 1,
"histogram": [
{
"bucket": "40-50",
"count": 1
}
]
}
}
| Field | Type | Meaning |
|---|---|---|
data.attempts |
integer |
Graded attempts counted. |
data.pass_count |
integer |
|
data.pass_rate |
number |
Percent. |
data.mean |
number|null |
Mean percent. |
data.median |
number|null |
|
data.min |
number|null |
|
data.max |
number|null |
|
data.stddev |
number|null |
|
data.avg_seconds |
integer|null |
|
data.histogram[] |
object[] |
Attempts per 10-percent band. |
data.histogram[].bucket |
string |
|
data.histogram[].count |
integer |
Errors
| Status | Code | When |
|---|---|---|
401 |
INVALID_TOKEN |
No token (MISSING_TOKEN), or one that is wrong, expired, revoked, or whose owner can no longer sign in (INVALID_TOKEN). |
403 |
MISSING_SCOPE |
The token is valid but this request is not allowed, and code says why: MISSING_SCOPE (the token lacks the scope), FORBIDDEN (the owner's role does not allow it), ACCESS_DENIED (the owner cannot manage Next Exams), API_DISABLED (the API Tokens app is off), APP_DISABLED (the feature's app is off — meta.app names it), ACCOUNT_UNUSABLE (the owner is blocked or must reset their password), DEMO_LOCKED (a demo site). |
Examples
curl
curl -s "https://your-site.example/api/index.php/v1/nextexams/reports/1/overview" \
-H "Authorization: Bearer $API_TOKEN"
PHP
<?php
$ch = curl_init('https://your-site.example/api/index.php/v1/nextexams/reports/1/overview');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('API_TOKEN'),
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
JavaScript
const API_TOKEN = process.env.API_TOKEN;
const response = await fetch("https://your-site.example/api/index.php/v1/nextexams/reports/1/overview", {
headers: {
"Authorization": `Bearer ${API_TOKEN}`,
},
});
const data = await response.json();