expire_date is today or in the future.expire_date alone. will_expire is a different question entirely - it records whether the resulting certification is time-limited, as with First Aid - and does not enter this filter.App\Http\Controllers\Api\V1\Diver\CourseController::index()api.v1.diver.courses.indexAuthorization: Bearer {token}GET/api/v1/diver/courses200 OK{
"success": true,
"status": "success",
"message": "OK",
"data": [
{
"log_code": "c092ba15c46c023e0140f9b8e93bf89e",
"course": {
"id": 52,
"name": "Deco 40/130",
"group": "recreational",
"need_quiz": true,
"need_exam": true,
"need_skills": true
},
"instructor": null,
"dive_center": {
"id": 267,
"name": "OLOTURIA SUB"
},
"purchase_date": "2015-05-05",
"expire_date": "2027-11-05",
"quiz_lock": false,
"admin_lock": false,
"exam_enable": true,
"is_completed": false
}
]
}"data": [], not an error.| Field | Type | Nullable | Always present | Description |
|---|---|---|---|---|
data[].log_code | string(32) | No | Yes | Opaque code identifying this enrolment. Use it on every other course endpoint. Not a primary key |
data[].course.id | integer | No | Yes | Catalogue course id |
data[].course.name | string | No | Yes | |
data[].course.group | string | Yes | Yes | Enum value, for example recreational |
data[].course.need_quiz | boolean | Yes | Yes | Whether the course includes module quizzes |
data[].course.need_exam | boolean | Yes | Yes | Whether the course includes a final exam |
data[].course.need_skills | boolean | Yes | Yes | Whether the course includes skills to sign |
data[].instructor | object | Yes | Yes | {id, full_name}, or null when no instructor is assigned |
data[].dive_center | object | Yes | Yes | {id, name}, or null |
data[].purchase_date | string | Yes | Yes | Y-m-d |
data[].expire_date | string | Yes | Yes | Y-m-d. What decides active versus expired |
data[].quiz_lock | boolean | No | Yes | Quizzes locked for this enrolment |
data[].admin_lock | boolean | No | Yes | Locked by an administrator |
data[].exam_enable | boolean | No | Yes | The diver may sit the exam |
data[].is_completed | boolean | No | Yes |
course.need_* flags describe the catalogue course, not this enrolment's progress.401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}message is one of Unauthenticated, Invalid token, Token expired.GET /api/v1/diver/courses/expired, which returns the same shape for the other side of the same date test.docs/api/diver/courses/GET_list.mdcurl --location 'https://test.diveraid.com/api/v1/diver/courses' \
--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"
}
}
}
]
}