log_code, from the point of view of the instructor who issued it: the certifications the caller issued under that log_code, every quiz attempt, every exam attempt, and every skill progress entry. Served by CertificationController::history().{log_code} is a plain string, not route-model-bound: the controller queries Certification::where('log_code', $log_code). A log_code no certification carries returns 404. If none of the certifications with that log_code was issued by auth()->id(), 403.log_code carries more than one certification when the student has leveled up: one certification per level reached, all sharing the same log_code, possibly issued by different instructors. certifications holds only the ones the caller issued, ordered by the level's sort then by certification_date. Quizzes, exams and skill logs are read by log_code and are not filtered by instructor (see Notes).App\Http\Controllers\Api\V1\Professional\CertificationController::history()api.v1.professional.certifications.historyAuthorization: Bearer {token}role:professional. A user without the professional role receives 403.GET/api/v1/professional/certifications/{log_code}/history| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Certification log code, as returned by GET /api/v1/professional/certifications. Not a primary key. |
200 OKlog_code with 1 certification, 2 quizzes, 1 exam and 1 skill log. Abbreviated to 1 question per quiz and exam and 1 skill per skill log. The two certifications below are illustrative: they show a log_code that reached two levels, both issued by the caller. Names and ids are examples.{
"success": true,
"status": "success",
"message": "OK",
"data": {
"certifications": [
{
"resource": "Certification",
"data": {
"log_code": "5b0c7e2a91d34f6e8a1c2d3e4f506172",
"course": "Example Advanced Course",
"course_level": "Example Level 1",
"distributor": "Example Distributor",
"dive_center": "Example Dive Center",
"instructor": "Example Instructor",
"order_id": null,
"is_associated": false,
"associated_log": null,
"is_renewed": 0,
"will_expire": false,
"expire_date": null,
"is_crossover": false,
"leveling_up": false,
"leveling_up_from": null,
"leveling_id": null,
"is_upgrade": false,
"upgrade_course": null,
"previous_certification": null
}
},
{
"resource": "Certification",
"data": {
"log_code": "5b0c7e2a91d34f6e8a1c2d3e4f506172",
"course": "Example Advanced Course",
"course_level": "Example Level 2",
"distributor": "Example Distributor",
"dive_center": "Example Dive Center",
"instructor": "Example Instructor",
"order_id": null,
"is_associated": false,
"associated_log": null,
"is_renewed": 0,
"will_expire": false,
"expire_date": null,
"is_crossover": false,
"leveling_up": false,
"leveling_up_from": null,
"leveling_id": null,
"is_upgrade": false,
"upgrade_course": null,
"previous_certification": "Example Level 1 certification"
}
}
],
"quizzes": [
{
"id": 700001,
"log_code": "5b0c7e2a91d34f6e8a1c2d3e4f506172",
"module_id": 274,
"total": 10,
"correct": 9,
"wrong": 1,
"score": 90,
"passed": true,
"date": "2020-07-25",
"start": "2020-07-25 05:50:14",
"end": "2020-07-25 05:54:10",
"questions": [
{
"id": 4567,
"text": "Example quiz question",
"missing": false,
"answers": [
{ "id": 17537, "text": "Example wrong answer", "is_correct": false, "selected": true },
{ "id": 17538, "text": "Example right answer", "is_correct": true, "selected": false }
]
}
]
}
],
"exams": [
{
"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 }
]
}
]
}
],
"skills": [
{
"id": 160001,
"log_code": "5b0c7e2a91d34f6e8a1c2d3e4f506172",
"skill_type_id": 2,
"skill_type_name": "Open Water",
"user_completed": [8, 0, 8, 100, 1],
"start": "2023-12-13 19:35:25",
"end": "2023-12-14 23:59:59",
"skills": [
{
"id": 1279,
"name": "Example skill",
"description": "<p>Example skill description.</p>",
"diver_signed": true,
"instructor_signed": true
}
]
}
]
}
}| Field | Type | Nullable | Notes |
|---|---|---|---|
certifications | array | No | CertificationResource collection, docs/api/diver/_resources.md -> "Certification". Only the certifications of that log_code issued by the caller, ordered by the level's sort then by certification_date |
quizzes | array | No | QuizResultResource collection, docs/api/diver/_resources.md -> "Quiz result". Every quiz of the log_code |
exams | array | No | ExamResultResource collection, docs/api/diver/_resources.md -> "Exam result". Every exam of the log_code |
skills | array | No | SkillProgressResource collection, docs/api/diver/_resources.md -> "Skill progress entry". [] when the log_code has no skill log records |
certification key: the singular key of the earlier primary-key version of this route is gone.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. The second case uses the standard envelope:{
"success": false,
"status": "error",
"message": "Forbidden"
}404 Not Foundlog_code.{
"success": false,
"status": "error",
"message": "Resource not found"
}429 Too Many Requestsx-ratelimit-limit: 120. The body is the standard envelope with message: "Too many requests" and a Retry-After header.log_code; the capture behind it held a single certification, which is the common case.log_code, that certification is left out of certifications, and the caller still gets 200 as long as they issued at least one.quizzes, exams and skills are read by log_code and are not filtered by instructor. After a level-up certified by another instructor they can include skills that other instructor signed.quizzes and exams carries its full answers array, and each answer exposes is_correct alongside selected.docs/api/professional/certifications/GET_history.mdcurl --location 'https://test.diveraid.com/api/v1/professional/certifications//history' \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "string",
"data": {
"log_code": "string",
"course": "string",
"quizzes": [
{
"id": 0,
"log_code": "string",
"module_id": 0,
"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
}
]
}
]
}
],
"exams": [
{
"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
}
]
}
]
}
],
"skills": [
{
"id": 0,
"log_code": "string",
"skill_type_id": 0,
"skill_type_name": "string",
"user_completed": true,
"start": "2019-08-24T14:15:22.123Z",
"end": "2019-08-24T14:15:22.123Z",
"skills": [
{
"id": 0,
"name": "string",
"description": "string",
"diver_signed": true,
"instructor_signed": true
}
]
}
]
}
}