Skip to content

Courses

Jack Fountain edited this page Dec 14, 2025 · 3 revisions

Create Course

Creates course based on provided params.

Authentication

Currently only requires session cookie.

Once we have proper auth roles it should be limited elevated roles only.

URL

POST /api/courses/

Request Form Data

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

Response Parameters

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

Example Response

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
}

Index Courses

Shows all courses belonging to a user OR all courses if the user is an admin.

Authentication

Requires session cookie.

URL

GET /api/courses/

Request Form Data

None.

Response

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

Example Response

[
    {
        "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
    }
]

Course Details

Shows specific course details, units and subtopics.

Authentication

Requires session cookie.

URL

GET /api/courses/:course_id/

Request Form Data

None.

Response

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

Example Response

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": []
        },
    ]
}

Update Course

Updates specific course.

Authentication

Requires session cookie.

URL

PUT (replaces entire course) or PATCH (partial update) /api/courses/:course_id/

Request Form Data

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

Response

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

Example Response

{
    "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
}

Delete Course

Destroys specific course.

Authentication

Requires session cookie.

URL

DELETE /api/courses/:course_id/

Request Form Data

None.

Response

None.


Clone this wiki locally