Skip to content

ConU Course Planner API

David Huculak edited this page Oct 17, 2017 · 26 revisions

Our REST API

Under the hood, ConU Course Planner uses a set of HTTP web resources built for Concordia University useful for viewing individual courses' info & department-recommended course sequences, and validating/exporting user-defined course sequences.

This REST API is open to be used by anyone. If you find our tools useful, feel free to use this API to build an entirely separate application of your own!

Below lies a list of all of the endpoints (URLs) we provide, along with the expected request/response bodies. You can paste any of the curl commands from the examples into git bash on windows or the regular terminal on most linux distributions to test the API yourself. You could also use something like postman.

POST /api/courseinfo

By passing in a course code, you can get all of its relevant information such as its name, number of credits, pre-requisites, etc.

Request parameters:

code (required, string)

  • The course code whose info you want to retrieve
  • Must match the regex pattern: ^[A-Z]{4} [0-9]{3,4}$

Expected response format:

  • If the course does not exist, the server will response with an empty object: {}

  • If the request succeeds, the response body will be an object containing many properties related to the course in question. We have defined the exact format of this object in a json-schema file which you can view here.

Example:

Request

curl -H "Content-Type: application/json" -X POST -d '{"code": "COMP 248"}' http://conucourseplanner.online/api/courseinfo

Response

{  
   "_id":"COMP 248",
   "code":"COMP 248",
   "name":"Object-Oriented Programming I",
   "credits":"3.5",
   "description":"Introduction to programming. Basic data types, variables, expressions, assignments, control flow. Classes, objects, methods. Information hiding, public vs. private visibility, data abstraction and encapsulation. References. Arrays. ",
   "lectureHours":"three hours per week",
   "tutorialHours":"two hours per week",
   "labHours":"one hour per week",
   "requirements":{  
      "prereqs":[],
      "coreqs":[  
         [  
            "MATH 204"
         ]
      ]
   }
}

POST /api/export

to be continued

Clone this wiki locally