log_code. Served by CertificationController::historyExam(). Same ExamResultResource shape as docs/api/diver/courses/GET_exam_results.md.{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. Ownership is checked against the resolved set of certifications for that log_code: 403 if none belong to auth()->id(), or if {exam}'s log_code doesn't match the route's.App\Http\Controllers\Api\V1\Diver\CertificationController::historyExam()api.v1.diver.certifications.history.examAuthorization: Bearer {token}GET/api/v1/diver/certifications/{log_code}/exam/{exam}| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Certification log code, as returned by GET /api/v1/diver/certifications |
{exam} | integer | Exam attempt id |
200 OK{
"success": true,
"status": "success",
"message": "OK",
"data": {
"id": 7063,
"log_code": "f7efa55017629461ccd0b8bf303bfb91",
"total": 45,
"correct": 45,
"wrong": 0,
"score": 100,
"passed": true,
"date": "2014-11-28",
"start": "2014-11-28 03:56:06",
"end": "2014-11-28 04:09:25",
"questions": [
{
"id": 1418,
"text": "Can you hold your breath at any time while diving or hovering?",
"answers": [
{ "id": 5641, "text": "Yes", "is_correct": false, "selected": false },
{ "id": 5642, "text": "No, never hold your breath while diving", "is_correct": true, "selected": true }
]
}
]
}
}_resources.md → "Exam result".401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}403 Forbiddenlog_code's certifications belong to the authenticated user, or {exam}'s log_code doesn't match the route's.{
"success": false,
"status": "error",
"message": "Forbidden"
}404 Not Found — log_code not found{log_code} does not resolve to any certification.{
"success": false,
"status": "error",
"message": "Resource not found"
}404 Not Found — exam not found{exam} is still route-model-bound; this is Laravel's default route-model-binding 404, not the standard envelope.{
"message": "No query results for model [App\\Models\\CourseLog\\Exam] 999999999"
}is_correct flag — same caveat as docs/api/diver/courses/GET_exam_results.md.curl --location 'https://test.diveraid.com/api/v1/diver/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",
"answers": [
{
"id": 0,
"text": "string",
"is_correct": true,
"selected": true
}
]
}
]
}
}