-
Notifications
You must be signed in to change notification settings - Fork 0
Courses
Jack Fountain edited this page Dec 14, 2025
·
3 revisions
Creates course based on provided params.
Currently only requires session cookie.
Once we have proper auth roles it should be limited elevated roles only.
POST /api/courses/
| Parameter | Type | Description | Requirement Type | Example |
|---|---|---|---|---|
| name | string | Display name of the course | Required | Introductory Chemistry ii |
| code | string | McMaster's official course code | Required | CHEM 1AA3 |
| description | string | McMaster's official course description | Required | A discussion of organic chem... |
| year | string | Year the course is being run | Required | 2025 |
| semester | string | Semester the course is being run | Required | Fall, Winter, Spring, Summer, Multi-term |
| is_archived | boolean | Whether or not the course is archived | Required | True/False |
| Parameter | Type | Description |
|---|---|---|
| id | integer | ID of the created course |
| name | integer | Display name of the created course |
| code | string | McMaster styled course code of the created course |
| description | string | Description of the course |
| year | integer | Year the course is running |
| semester | string | Semester the course is running |
| is_archived | boolean | If the course is no longer running |
HTTP 201 Created
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"id": 1,
"name": "Introductory Chemistry II",
"code": "CHEM 1AA3",
"description": "A study of natural processes including plate tectonics, earthquakes, volcanoes, landslides, river erosion and climate change and their impacts on human populations.",
"year": 2025,
"semester": "FALL",
"is_archived": false
}
Shows all courses belonging to a user OR all courses if the user is an admin.
Requires session cookie.
GET /api/courses/
None.
| Parameter | Type | Description |
|---|---|---|
| id | integer | ID of the created course |
| name | integer | Display name of the created course |
| code | string | McMaster styled course code of the created course |
| description | string | Description of the course |
| year | integer | Year the course is running |
| semester | string | Semester the course is running |
| is_archived | boolean | If the course is no longer running |
[
{
"id": 2,
"name": "Natural Disasters",
"code": "EARTHSC 2GG3",
"description": "A study of natural processes including plate tectonics, earthquakes, volcanoes, landslides, river erosion and climate change and their impacts on human populations.",
"year": 2025,
"semester": "FALL",
"is_archived": false
},
{
"id": 1,
"name": "Introductory Chemistry II",
"code": "CHEM 1AA3",
"description": "A discussion of organic chemistry, chemical kinetics and acid-base equilibrium, with emphasis on relevant experimental techniques and solving real problems ranging from drug discovery to environmental chemistry.",
"year": 2026,
"semester": "WINTER",
"is_archived": false
}
]
Shows specific course details, units and subtopics.
Requires session cookie.
GET /api/courses/:course_id/
None.
| Parameter | Type | Description |
|---|---|---|
| id | integer | ID of the created course |
| name | integer | Display name of the created course |
| code | string | McMaster styled course code of the created course |
| description | string | Description of the course |
| year | integer | Year the course is running |
| semester | string | Semester the course is running |
| is_archived | boolean | If the course is no longer running |
| units | list of units | List of units related to the course |
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"id": 2,
"name": "Natural Disasters",
"code": "EARTHSC 2GG3",
"description": "A study of natural processes including plate tectonics, earthquakes, volcanoes, landslides, river erosion and climate change and their impacts on human populations.",
"year": 2025,
"semester": "FALL",
"is_archived": false,
"units": [
{
"id": 7,
"number": 1,
"name": "Hazards, Disasters and Plate Tectonics",
"description": "",
"course": 2,
"subtopics": [
{
"id": 27,
"name": "Hazards and Disasters",
"description": "",
"unit": 7,
"study_aids": [
{
"id": 1,
"name": "Titrations and indicators",
"reference": "https://www.macvideo.ca/media/1Aa3-Problem%20Solving%20-%20Acid-Baseq1%20Fixed.mp4/1_914hkq45",
"subtopic": 1,
"aid_type": 1
}
]
},
{
"id": 28,
"name": "Plate Tectonics",
"description": "",
"unit": 7,
"study_aids": []
}
]
},
{
"id": 8,
"number": 2,
"name": "Earthquakes",
"description": "",
"course": 2,
"subtopics": []
},
{
"id": 9,
"number": 3,
"name": "Volcanoes",
"description": "",
"course": 2,
"subtopics": []
},
{
"id": 10,
"number": 4,
"name": "Mass Wasting",
"description": "",
"course": 2,
"subtopics": []
},
{
"id": 11,
"number": 5,
"name": "Tsunami Waves",
"description": "",
"course": 2,
"subtopics": []
},
]
}
Updates specific course.
Requires session cookie.
PUT (replaces entire course) or PATCH (partial update)
/api/courses/:course_id/
| Parameter | Type | Description | PUT | PATCH | Example |
|---|---|---|---|---|---|
| name | string | Display name of the course | Required | Optional | Introductory Chemistry II |
| code | string | McMaster's official course code | Required | Optional | CHEM 1AA3 |
| description | string | McMaster's official course description | Optional | Optional | A discussion of organic chem... |
| year | string | Year the course is being run | Required | Optional | 2025 |
| semester | string | Semester the course is being run | Required | Optional | Fall, Winter, Spring, Summer, Multi-term |
| is_archived | boolean | Whether or not the course is archived | Optional | Optional | True/False |
| Parameter | Type | Description |
|---|---|---|
| id | integer | ID of the created course |
| name | integer | Display name of the created course |
| code | string | McMaster styled course code of the created course |
| description | string | Description of the course |
| year | integer | Year the course is running |
| semester | string | Semester the course is running |
| is_archived | boolean | If the course is no longer running |
{
"id": 1,
"name": "Introductory Chemistry II",
"code": "CHEM 1AA4",
"description": "A discussion of organic chemistry, chemical kinetics and acid-base equilibrium, with emphasis on relevant experimental techniques and solving real problems ranging from drug discovery to environmental chemistry.",
"year": 2026,
"semester": "WINTER",
"is_archived": false
}
Destroys specific course.