log_code. Served by CertificationController::historyExam(). Same ExamResultResource shape as the exams entries of GET /api/v1/professional/certifications/{log_code}/history.{log_code} is a plain string, not route-model-bound; {exam} stays route-model-bound by primary key. A log_code no certification carries returns 404. 403 if none of the certifications with that log_code was issued by auth()->id(), or if {exam}'s log_code does not match the route's.App\Http\Controllers\Api\V1\Professional\CertificationController::historyExam()api.v1.professional.certifications.history.examAuthorization: Bearer {token}role:professional. A user without the professional role receives 403.GET/api/v1/professional/certifications/{log_code}/exam/{exam}| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Certification log code, as returned by GET /api/v1/professional/certifications |
{exam} | integer | Exam attempt id, as returned in exams[].id by the history route |
200 OK{
"success": true,
"status": "success",
"message": "OK",
"data": {
"id": 180001,
"log_code": "5b0c7e2a91d34f6e8a1c2d3e4f506172",
"total": 15,
"correct": 14,
"wrong": 1,
"score": 93,
"passed": true,
"date": "2023-12-13",
"start": "2023-12-13 11:45:40",
"end": "2023-12-13 11:58:14",
"questions": [
{
"id": 4551,
"text": "Example exam question",
"missing": false,
"answers": [
{ "id": 17469, "text": "Example wrong answer", "is_correct": false, "selected": false },
{ "id": 17471, "text": "Example right answer", "is_correct": true, "selected": true }
]
}
]
}
}docs/api/diver/_resources.md -> "Exam result".401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}message is Token expired or Invalid token when a bearer token was sent but is expired or unknown.403 Forbiddenprofessional role (role:professional middleware, body not captured), or no certification carrying that log_code was issued by the caller, or {exam}'s log_code does not match the route's. The last two use the standard envelope:{
"success": false,
"status": "error",
"message": "Forbidden"
}404 Not Found{log_code} does not resolve to any certification, with the standard envelope:{
"success": false,
"status": "error",
"message": "Resource not found"
}{exam} id that does not exist also returns 404, from route-model binding rather than from the controller; its body was not captured for this route.429 Too Many Requestsx-ratelimit-limit: 120. The body is the standard envelope with message: "Too many requests" and a Retry-After header.is_correct flag alongside selected.log_code, not on the exam: any exam of a log_code the caller issued at least one certification for is readable, whoever the student is.docs/api/professional/certifications/GET_history_exam.mdcurl --location 'https://test.diveraid.com/api/v1/professional/certifications//exam/' \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "string",
"data": {
"id": 0,
"log_code": "string",
"total": 0,
"correct": 0,
"wrong": 0,
"score": 0,
"passed": true,
"date": "2019-08-24",
"start": "2019-08-24T14:15:22.123Z",
"end": "2019-08-24T14:15:22.123Z",
"questions": [
{
"id": 0,
"text": "string",
"missing": true,
"answers": [
{
"id": 0,
"text": "string",
"is_correct": true,
"selected": true
}
]
}
]
}
}