Web Services - priyankt/mobilearn GitHub Wiki
Return true, auth_key if successful, else false & error
-
post /login
- params => email, passwd
- returns => {success:'true-or-false',api_key:'api-key-if-success-true',first_login:'true-if-first-time-login',errors:['if-login-failed', ...]}
Return true if successful, else false & error. Send an email notification with new password
-
post /change_passwd
- params => old_passwd, new_passwd
- returns => {success:'true-or-false',errors:['if-login-failed', ...]}
Return the about us description of institute
-
get /api/about/:institute_id
- params => institute_id
- returns => {about:'html-value'}
Return the list of courses & subjects for which a student is registered
-
get /api/courses
- params => none - student id will be obtained using auth key
- returns => [{id:'course-id',name:,desc:,subjects:[{id:,name:,desc:}]}, ...]
Return the list of chapters within a course
-
get /api/chapters/:subject_id
- params => subject_id
- returns => [{id:,name:,desc:,summary:,questions:,videos:}, ...]
Return the summary of the selected chapter
-
get /api/summary/:chapter_id
- params => chapter_id
- returns => {summary:}
Return the list of videos for the chapter if exists
-
get /api/videos/:chapter_id
- params => chapter_id
- returns => [{id:,title:,desc:,video_url:}, ...]
Return the list of questions for the chapter
-
get /api/questions/:chapter_id
- params => chapter_id
- returns => [{id:,text:,option_1:,option_2:,option_3:,option_4:,option_5:,answer:,answer_desc:,last_answer:}, ....]
Return true if answer is saved else return false
-
post /api/questions/:question_id
- params => question_id, user_answer
- returns => {success:}
Return array of matched chapters, empty array of no results found
-
get /api/search/:subject_id
- params => subject_id, keyword
- returns => [{id:'id-of-chapter',name:'name-of-chapter',text:'html-content-of-chapter'}]