-
Notifications
You must be signed in to change notification settings - Fork 0
API
Alexander Van Oyen edited this page Mar 9, 2024
·
27 revisions
We will probably be using swagger/openAPI for our API implementation.
(Admins should be able to perform every request, they will have no restrictions.)
Method | Endpoint | Description | Status Code Success |
---|---|---|---|
POST | /user | create a new user (returns the id) | 201 |
PUT | /user/{userid} | update user data | 200 |
DELETE | /user/{userid} | delete a user | 200/204 (depends if you return the deletd data or not) |
GET | /user/{userid} | get user data | 200 |
Method | Endpoint | Description | Status Code Success |
---|---|---|---|
POST | /course | create a new course (returns the id) | 201 |
DELETE | /course/{course_id} | delete course with given id | 200/204 (depends if you return the deletd data or not) |
PUT | /course/{course_id} | update course data | 200 |
GET | /course/{course_id} | get all data about a course | 200 |
POST | /course/{course_id}/project | create a new project for a course | 201 |
DELETE | /course/{course_id}/project/{project_id} | delete a project from a course | 200/204 (depends if you return the deletd data or not) |
GET | /course/{course_id}/project/{project_id} | get all data about a project (get submissions) | 200 |
PUT | /course/{course_id}/project/{project_id} | update project data (for example: visibility of project) | 200 |
POST | /course/{course_id}/project/{project_id} | Archive project | 201 |
POST | /user/course/{course_id}/project/{project_id}/group/{group_id} | create new group for project | 201 |
PUT | /user/course/{course_id}/project/{project_id}/group/{group_id} | update group data | 200 |
Method | Endpoint | Description | Status Code Success |
---|---|---|---|
GET | /user | get all user data (can only access own data) | 200 |
PUT | /user | update user data (can only update own data) | 200 |
DELETE | /user | remove the user (can only remove themself) | 200/204 (depends if you return the deletd data or not) |
POST | /user/course/{course_id} | subscribe to course | 201 |
PUT | /user/course/{course_id} | unsubscribe to course | 200 |
POST | /user/course/{course_id}/project/{project_id} | submit project | 201 |
PUT | /user/course/{course_id}/project/{project_id} | update project submission | 200 |
GET | /user/course/{course_id}/project/{project_id} | get project submission | 200 |
POST | /user/course/{course_id}/project/{project_id}/group/{group_id} | join group | 201 |
GET | /user/course/{course_id}/project/{project_id}/group/{group_id} | get group data (members, ...) | 200 |
- 401: This status code is returned when the client is unauthorized to perform this request. Example: This could happen when a user tries to delete another user.
- 403: The user is unauthorized but known.
- 404: wrong endpoint (could mean that the group/user/course id's are wrong)