GET
returns list of courses
POST
returns
200
success
409
duplicate entry
500
server error
/api/<facultyName>/<courseID>
GET
returns course info
POST
returns
200
success
409
duplicate entry
500
server error
Parameter |
Description |
email: required |
Email of user to look for |
ta: optional |
Search tas table |
professor: optional |
Search professors table |
admin: optional |
Search admins table |
NOTE: Searches tables in order and returns first match. TA -> Professor -> Admin
curl -X GET <url>/api/users \
-H 'Content-Type: application/json' \
-d '{ "email": "[email protected]", "professor": true }
Parameter |
Description |
email: required |
Email of user to look for |
firstName: optional |
User first name |
lastName: optional |
User last name |
curl -X GET <url>/api/users \
-H 'Content-Type: application/json' \
-d '{ "email": "[email protected]", "firstName": "Bobby", "lastName": "Chan" }
POST
returns
200
success
409
duplicate entry
500
server error
Parameter |
Description |
email: required |
Email of user to look for |
curl -X GET localhost:8080/api/users -H 'Content-Type: application/json' -d '{ "email": "[email protected]" }'
[{"facultyName":"CMPT","courseID":"372"}]
Parameter |
Description |
email: required |
Email of user to look for |
courseID: required |
Course to enroll in |
facultyName: required |
Faculty to enroll in |
Parameter |
Description |
courseID: required |
Course message was sent to |
facultyName: required |
Faculty message was sent to |
limit: optional |
Set number of messages to return or 50 |
curl -X GET <url>/api/messages \
-H 'Content-Type: application/json' \
-d '{ "courseID": "372", "facultyName": "CMPT", "limit": 50 }
Parameter |
Description |
email: required |
Email of user who sent message |
courseID: required |
Course message was sent to |
facultyName: required |
Faculty message was sent to |
text: required |
Time message was sent/updated |
edited: optional |
Flag noting message was edited |
curl -X POST <url>/api/messages \
-H 'Content-Type: application/json' \
-d '{ "email": "[email protected], "courseID": "372", "facultyName": "CMPT", "text": "Hello world!" }