FreeLearningController::show(). Renders the same CourseLogDetailResource as GET /api/v1/diver/courses/{log_code}.App\Http\Controllers\Api\V1\Diver\FreeLearningController::show()api.v1.diver.free-learnings.showexam_status and skills_count are null, and need_exam and need_skills are always false, whatever the course flags are. need_quiz comes from the course. modules are the active modules of the course's current version. Each module carries manual_url (string|null): the absolute URL of the module manual in the request locale, null when the module has no manual.Authorization: Bearer {token}GET/api/v1/diver/free-learnings/{log_code}| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Opaque free learning log code owned by the authenticated diver |
200 OK{
"success": true,
"status": "success",
"message": "OK",
"data": {
"log_code": "9be9084934f36b03bbbb70c38acb9d50",
"course": {
"id": 12,
"name": "Example Free-Learning Course",
"group": "trainer",
"need_quiz": true,
"need_exam": false,
"need_skills": false
},
"instructor": null,
"dive_center": null,
"purchase_date": "2020-03-30",
"expire_date": null,
"quiz_lock": false,
"admin_lock": false,
"exam_enable": false,
"modules": [
{
"id": 301,
"name": "Module 1",
"quiz_questions": 10,
"quiz_minimum": 7,
"manual_url": "https://example.com/modules/301_course/manual-en.pdf",
"quiz_status": null
}
],
"exam_status": null,
"skills_count": null,
"is_completed": false
}
}modules lists the active modules of the course's current version, in the same shape as GET /api/v1/diver/courses/{log_code}.401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}404 Not Found{log_code} not owned by the authenticated user (firstOrFail()), same shape as docs/api/diver/courses/GET_show.md.{
"message": "No query results for model [App\\Models\\CourseLog\\FreeLearning]."
}current_version explicitly: eager loading course.modules matched no row.500 until 23c8454ad: the shared resource called skills_completed as a property instead of a method, and called exams() on FreeLearning, which has no such relation. Both are fixed; the endpoint answers 200 today.docs/api/diver/free-learnings/GET_show.mdcurl --location 'https://test.diveraid.com/api/v1/diver/free-learnings/' \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "string",
"data": {
"log_code": "string",
"course": {
"id": 0,
"name": "string",
"group": "string",
"need_quiz": true,
"need_exam": true,
"need_skills": true
},
"instructor": {
"id": 0,
"full_name": "string"
},
"dive_center": {
"id": 0,
"name": "string"
},
"purchase_date": "2019-08-24",
"expire_date": "2019-08-24",
"quiz_lock": true,
"admin_lock": true,
"exam_enable": true,
"is_completed": true,
"is_repetition": true,
"repetition": {
"confirmed_at": "2019-08-24T14:15:22.123Z",
"confirmed_by": {
"id": 0,
"full_name": "string"
}
},
"exam_unlock_hash": "string",
"modules": [
{
"id": 0,
"name": "string",
"quiz_questions": 0,
"quiz_minimum": 0,
"manual_url": "string",
"quiz_status": {
"passed": true,
"score": 0,
"date": "2019-08-24"
}
}
],
"exam_status": {
"passed": true,
"score": 0,
"date": "2019-08-24"
},
"skills_count": {
"total": 0,
"signed": 0
}
}
}