Skip to content

Backend Endpoints

Adam Ross edited this page Apr 5, 2022 · 9 revisions

A list of endpoints for access. Excludes those used for testing. Note: These endpoints all produce and consume JSON.

Validation

GET: /api/validate

Checks that a JWT token is valid
Response: 204 No Content

Pairing

POST: /api/pairing/matchBuddy

Finds possible buddy matches for a user given a list of course IDs to match through
Request Body: Array of course IDs under "courseIds" key
Response: 200 OK
Response Body: Array of Users

Communication

GET: /api/communication/messages/{id}

Gets an array of all messages sent to user id specified in path
Response: 200 OK
Response Body: Array of Messages

GET: /api/communication/chatlist

Gets an array of all the chatroom's associated with a given user
Response: 200 OK
Response Body: Array of Chats

DELETE: /api/communication/messages/{id}

Deletes all messages between the current user and the given user id
Response: 200 OK

Timetable

POST: /api/timetable/users/upload

Upload a course timetable URL for the current table
Request Body: String containing URL to timetable
Response: 200 OK

POST: /api/timetable/users/upload/file

Upload a course timetable .ics file for the current table
Request Body: MultipartFile containing the .ics timetable file
Response: 200 OK

GET: /api/timetable/users/courses

Gets the current user's courses
Response: 200 OK
Response Body: Array of Courses taken by current User

GET: /api/timetable/users/courses/{id}

Gets the courses for a specified user id in path
Response: 200 OK
Response Body: Array of Courses taken by specified User

GET: /api/timetable/course/{id}

Get a course by specified course id in path
Response: 200 OK
Response Body: Course corresponding to specified id

DELETE: /api/timetable/course/{id}

Delete a course by specified course id in path, for current user to withdraw from course
Response: 200 OK

Users

GET: /api/users

Get the current User
Response: 200 OK
Response Body: Current User

PUT: /api/users

Update the pairingEnabled field in current User
Request Body: Boolean to set pairingEnabled to
Response: 200 OK
Response Body: User with updated pairingEnabled value

POST: /api/users/buddy/{id}

Add a buddy with specified id in path, to current User
Response: 200 OK

DELETE: /api/users/buddy/{id}

Delete a buddy with specified id in path, to current User
Response: 200 OK

GET: /api/users/{id}

Get a User with specified id in path
Response: 200 OK
Response Body: User corresponding to specified id

GET: /api/users/login

User logging in using Google
Response: 200 OK

GET: /api/users/buddy

Gets a list of buddies of a User
Response: 200 OK
Response Body: Array of Users who are "buddies" to current User

GET: /api/users/buddy/course/{course_id}

Gets a list of buddies of a User from a given course
Response: 200 OK
Response Body: Array of Users who are "buddies" to current User from a given course

POST: /api/users/block/{id}

Add a blocked user with specified id in path, blocked by current User
Response: 200 OK

GET: /api/users/block

Gets a list of users blocked by current User
Response: 200 OK
Response Body: Array of Users who are "blocked" by current User

DELETE: /api/users/block/{id}

Unblocks an existing blocked user
Response: 200 OK

POST: /api/users/report/{id}

Add a reported user with specified id in path, reported by current User
Response: 200 OK

Clone this wiki locally