id of each entry is the {classroom} parameter of GET /api/v1/professional/classroom/{classroom}. Served by ClassroomController::index().App\Http\Controllers\Api\V1\Professional\ClassroomController::index()api.v1.professional.classroom.indexAuthorization: Bearer {token}role:professional. A user without the professional role receives 403.GET/api/v1/professional/classroominstructor_id is the caller is returned.200 OK{
"success": true,
"status": "success",
"message": "OK",
"data": [
{
"id": 4001,
"name": "CAVERN DIVER @ 2025-01-10",
"course": {
"id": 301,
"name": "Cavern"
},
"dive_center": {
"id": 501,
"name": "Example Dive Academy"
},
"students_count": 1,
"is_crossover": false,
"is_level_up": false,
"created_at": "2025-01-10"
}
]
}data is a plain array, ordered as the database returns it. It is empty ([]) when the instructor owns no classroom.| Field | Type | Nullable | Always present | Description |
|---|---|---|---|---|
data[].id | integer | No | Yes | Classroom id. Pass it to GET /api/v1/professional/classroom/{classroom} |
data[].name | string | No | Yes | Classroom name |
data[].course.id | integer | No | Yes | Course id |
data[].course.name | string | Yes | Yes | Course name. null when the course no longer exists |
data[].dive_center.id | integer | Yes | Yes | Dive center id |
data[].dive_center.name | string | Yes | Yes | Dive center name. null when the classroom has no dive center |
data[].students_count | integer | No | Yes | Number of course logs enrolled in the classroom |
data[].is_crossover | boolean | No | Yes | Whether the classroom runs a crossover course |
data[].is_level_up | boolean | No | Yes | Whether the classroom runs a level-up course |
data[].created_at | string | Yes | Yes | Creation date, YYYY-MM-DD |
course.name, dive_center.id and dive_center.name comes from the controller source (null-safe access); a null was not observed in the capture.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.429 Too Many Requestsx-ratelimit-limit: 120. The body is the standard envelope with message: "Too many requests" and a Retry-After header.students_count counts the classroom's non-deleted course logs; it is computed with one query for the whole list, whatever the number of classrooms. Its value is unchanged.GET /api/v1/professional/classroom/{classroom} for them.docs/api/professional/classroom/GET_list.mdcurl --location 'https://test.diveraid.com/api/v1/professional/classroom' \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "string",
"data": [
{
"id": 0,
"name": "string",
"course": {
"id": 0,
"name": "string"
},
"dive_center": {
"id": 0,
"name": "string"
},
"students_count": 0,
"is_crossover": true,
"is_level_up": true,
"created_at": "2019-08-24"
}
]
}