Web Services - priyankt/mobilearn GitHub Wiki

Login

login

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', ...]}

Change Passwd

change_passwd

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', ...]}

About

get_about

Return the about us description of institute

  • get /api/about/:institute_id
    • params => institute_id
    • returns => {about:'html-value'}

Courses

get_courses

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:}]}, ...]

Chapters

get_chapters

Return the list of chapters within a course

  • get /api/chapters/:subject_id
    • params => subject_id
    • returns => [{id:,name:,desc:,summary:,questions:,videos:}, ...]

get_summary

Return the summary of the selected chapter

  • get /api/summary/:chapter_id
    • params => chapter_id
    • returns => {summary:}

get_videos

Return the list of videos for the chapter if exists

  • get /api/videos/:chapter_id
    • params => chapter_id
    • returns => [{id:,title:,desc:,video_url:}, ...]

get_questions

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:}, ....]

save_answer

Return true if answer is saved else return false

  • post /api/questions/:question_id
    • params => question_id, user_answer
    • returns => {success:}

search

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'}]
⚠️ **GitHub.com Fallback** ⚠️