API Learning Online (Student) | done
Student Role (kecuali login untuk kedua role(admin,student)). note: setiap route kecuali (login dan register), membutuhkan token bearer yang didapat setelah login
https://salmanhack.sanbersy.com/onlinelearning/api/v1/~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
string
password
string
{
"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
string
password
string
{
"message": "login success",
"token": {
"type": "bearer",
"token": "Mg.raPP7qPTdtTRXkgKq4GSDLeFwCyoguDkfFnUajw5KBHZP_DSYOtgI-UYkfbX"
}
}
Playlists
Show all playlists
GET
/api/v1/student/playlists
Headers
Bearer token
string
Bearer token didapat setelah login
{
"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
:id
integer
id playlist
Headers
Bearer token
string
{
"message": "success, berhasil mengikuti playlist Web Course"
}
Sections
Show all sections in playlist
GET
/api/v1/student/playlists/:idplaylist
Path Parameters
:idplaylist
integer
Headers
Bearer Token
string
{
"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
:serialnumbersection
integer
idplaylists
integer
{
"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
:numbervideo
integer
serial_number in videos
:numbersection
number
serial_number in sections
:idplaylist
integer
{
"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
:idplaylist
string
id playlist
:numbersection
integer
serial_number in sections
:numbervideo
integer
serial_number in videos
{
"message": "video has been watched"
}
Status of Playlists
Show status of all playlists (status perjalanan kelas)
GET
/api/v1/student/playlists/status
Headers
Bearer token
string
{
"data": 0
}
Show status of a playlist by id
GET
/api/v1/student/playlists/status/:id
Path Parameters
:id
integer
id playlist
Headers
Bearer token
string
{
"progress": 0
}
update status playlist
POST
/api/v1/student/playlists/status/:id
Path Parameters
:id
integer
Headers
Bearer token
string
{
"message": "playlist has been watched"
}
Last updated
Was this helpful?