Skip to content

REST Interface: Common

MikeKlemarewski edited this page Jul 26, 2012 · 19 revisions

Presenter Types: Question, Comment

User

Get User

  • gets full details about a user
  • command: GET /api/user/:uid
  • response: { errorcode: 0, user: { ... } }

Get User Courses

  • gets full details about a user
  • command: GET /api/user/courses
  • response: { errorcode: 0, courses: { ... } }

Get Users Based on a Custom Query

  • gets a list of users filtered by a custom query
  • command: POST /api/users/
  • request: { where: { ... } }
  • response: { errorcode: 0, users: [{ ... }, { ... }] }

Set User Preferred Name

  • updates the preferred name of the user who is logged in
  • command: PUT /api/user/setPreferedName
  • response: { errorcode: 0, user: { ... } }

Get User Profile

  • updates the preferred name of the user provided
  • command: GET /api/user/:id/profile
  • response: { errorcode: 0, profile: { ... } }

Update User Profile

  • updates the preferred name of the user provided
  • command: PUT /api/user/:id/profile
  • request:
{
    profilePicture: , "/path/to/pic",
    bio:"I like turtles",
    lastWatchedTag:"1A2B-3C4D-5E6F-7G8H"
}
  • response: { errorcode: 0, profile: { ... } }

Course

Get Course

  • gets full details about a course
  • command: GET /api/course/:uid
  • response: { errorcode: 0, course: { ... } }

Get Course Based on a Custom Query

  • gets a list of courses filtered by a custom query
  • command: POST /api/courses/
  • request: { where: { ... } }
  • response: { errorcode: 0, courses: [{ ... }, { ... }] }

Get Course Instructor

  • gets the instructor of the requested course
  • command: GET /api/course/:id/instructor
  • response: { errorcode: 0, instructor: { ... } }

Get Course Members

  • gets all members of a certain course
  • command: GET /api/course/:id/members
  • response: { errorcode: 0, members: { ... } }