Overview
This is the first version of API. The main purpose of this version of API is to provide a way for external applications, e.g., learning management system, to interact with iPeer with tighter integration and better user experience. Data returned will be in JSON format with XML support coming later.
Authentication
OAuth 2.0
Resources
Users
GET | /v1/users | get a list of users
|
GET | /v1/users/{id} | get a user with id
|
POST | /v1/users | create a user/users
|
DELETE | /v1/users/{id} | remove a user with id
|
PUT | /v1/users/{id} | update a user with id
|
Courses
GET | /v1/courses | get a list of courses for current logged in user
|
| parameter | none
|
| input | none
|
| status (success) | HTTP/1.0 200 OK
|
| output (success) | [{"id":"COURSE0_ID","course":"COURSE0_CODE","title":"COURSE0_TITLE"},{"id":"COURSE1_ID","course":"COURSE1_CODE","title":"COURSE1_TITLE"}]
|
| status (failure) | HTTP/1.0 404 Not Found
|
| output (failure) | No courses can be found
|
GET | /v1/courses/{id} | get a course with id
|
| parameter | COURSE_ID
|
| input | none
|
| status (success) | HTTP/1.0 200 OK
|
| output (success) | {"id":"COURSE_ID","course":"COURSE_CODE","title":"COURSE_TITLE"}
|
| status (failure) | HTTP/1.0 404 Not Found
|
| status (failure) | No course with id COURSE_ID can be found
|
POST | /v1/courses | create a course
|
| parameter | none
|
| input | {"Course":{"course":"COURSE_CODE","title":"COURSE_TITLE"},"Department":{"Department":[DEPARTMENT_ID]}}
|
| status (success) | HTTP/1.0 201 Created
|
| output (success) | COURSE_ID
|
| status (failure) | HTTP/1.0 500 Internal Server Error
|
| output (failure) | Error: the course was not added
|
DELETE | /v1/courses/{id} | remove a course with id
|
| parameter | COURSE_ID
|
| input | none
|
| status (success) | HTTP/1.0 204 No Content
|
| output (success) | COURSE_ID
|
| status (failure) | HTTP/1.0 500 Internal Server Error
|
| output (failure) | Error: the course was not deleted
|
PUT | /v1/courses/{id} | update a course with id
|
| parameter | none
|
| input | {"Course":{"id":"COURSE_ID","course":"COURSE_CODE","title":"COURSE_TITLE"}}
|
| status (success) | HTTP/1.0 200 OK
|
| output (success) | COURSE_ID
|
| status (failure) | HTTP/1.0 500 Internal Server Error
|
| output (failure) | Error: the course was not edited
|
Groups
GET | /v1/courses/{course_id}/groups | get a list of groups in course {course_id}
|
GET | /v1/courses/{course_id}/groups/id | get a group in course {course_id}
|
POST | /v1/courses{course_id}/groups | create a group in course {course_id}
|
DELETE | /v1/courses/{course_id}/groups/{id} | remove a group in course {course_id}
|
PUT | /v1/courses/{course_id}/groups/{id} | update a group in course {course_id}
|
Grades
GET | /v1/courses/{course_id}/grades | get a list of grades in course {course_id}
|
GET | /v1/courses/{course_id}/grades/id | get a grades in course {course_id}
|
Events
GET | /v1/courses/{course_id}/events | get a list of events in course {course_id}
|
GET | /v1/courses/{course_id}/events/id | get a event in course {course_id}
|