/~blablabla
note: patokan main path nya di atas ini ya. mungkin kebawahnya ga kami tulis ulang, yang penting udah tau main path nya
Regitster & Login
Register Student
POST
https://api.cakes.com/api/v1/register
This endpoint allows you to get free cakes.
Request Body
200
Copy {
"message": "Register Successfully",
"user": {
"email": "student@gmail.com",
"role": "student",
"created_at": "2021-02-06T23:07:10.645+07:00",
"updated_at": "2021-02-06T23:07:10.645+07:00",
"id": 2
}
}
Login
POST
/api/v1/login
Request Body
200
Copy {
"message": "login success",
"token": {
"type": "bearer",
"token": "Mg.raPP7qPTdtTRXkgKq4GSDLeFwCyoguDkfFnUajw5KBHZP_DSYOtgI-UYkfbX"
}
}
Playlists
Show all playlists
GET
/api/v1/student/playlists
Bearer token didapat setelah login
200
Copy {
"message": "success",
"status": 200,
"data": {
"progress": 0,
"playlists": [
{
"id_playlist": 2,
"title_playlist": "Web Course",
"desc_playlists": "this is description of playlist Web Course",
"status_playlist": null
},
{
"id_playlist": 3,
"title_playlist": "playlists 3",
"desc_playlists": "this is playlist 3",
"status_playlist": null
}
]
}
}
Join playlist by id
POST
/api/v1/student/playlists/:id/join
endpoint ini digunakan untuk student agar dapat melihat sections dan menonton video-video di dalam playlist tersebut
Path Parameters
200
Copy {
"message": "success, berhasil mengikuti playlist Web Course"
}
Sections
Show all sections in playlist
GET
/api/v1/student/playlists/:idplaylist
Path Parameters
200
Copy {
"message": "success",
"playlist": {
"id": 2,
"title": "title playlist second",
"description": "desc playlist second",
"listSection": [
{
"id": 4,
"user_id": 2,
"section_id": 4,
"status": null,
"title": "title section first",
"playlist_id": 2,
"serial_number": 1,
"created_at": "2021-02-06T15:23:52.000Z",
"updated_at": "2021-02-06T15:23:52.000Z"
},
{
"id": 3,
"user_id": 2,
"section_id": 3,
"status": null,
"title": "title section second",
"playlist_id": 2,
"serial_number": 2,
"created_at": "2021-02-06T15:23:34.000Z",
"updated_at": "2021-02-06T15:23:34.000Z"
}
videos
Show all videos in section in playlist
GET
/api/v1/student/playlists/:idplaylist/section/:serialnumberSection
Path Parameters
200
Copy {
"message": "success",
"status": 200,
"Section": {
"id": 3,
"title": "title section second",
"listvideos": [
{
"id": 8,
"user_id": 2,
"video_id": 8,
"status": null,
"title": "title video first section=1 playlist=1",
"description": "desc video first section=3 playlist=2",
"link": "link video first section=3 playlist=2",
"section_id": 3,
"serial_number": 1,
"created_at": "2021-02-06T15:57:38.000Z",
"updated_at": "2021-02-06T15:57:38.000Z"
},
{
"id": 7,
"user_id": 2,
"video_id": 7,
"status": null,
"title": "title video first section=1 playlist=1",
"description": "desc video second section=3 playlist=2",
"link": "link video second section=3 playlist=2",
"section_id": 3,
"serial_number": 2,
"created_at": "2021-02-06T15:41:55.000Z",
"updated_at": "2021-02-06T15:41:55.000Z"
}
]
}
}
Show video
GET
/v1/student/playlist/:idplaylist/sections/:numbersection/videos/:numbervideo
Path Parameters
serial_number in sections
200
Copy {
"message": "success",
"status": 200,
"data": [
{
"id video": 7,
"description video": "description video second section=3 playlist=2",
"title video": "title video first section=1 playlist=1",
"number video": 2,
"number section": 2,
"created_at": "2021-02-06T15:41:55.000Z",
"updated_at": "2021-02-06T15:41:55.000Z",
"link": "link video"
}
]
}
update status video
POST
api/v1/student/playlists/:idplaylist/sections/:numbersection/videos/:numbervideo
Path Parameters
serial_number in sections
200
Copy {
"message": "video has been watched"
}
Status of Playlists
Show status of all playlists (status perjalanan kelas)
GET
/api/v1/student/playlists/status
Show status of a playlist by id
GET
/api/v1/student/playlists/status/:id
Path Parameters
update status playlist
POST
/api/v1/student/playlists/status/:id
Path Parameters
200
Copy {
"message": "playlist has been watched"
}