/acorn-api-js

API for user actions on Acorn (University of Toronto student system) in TypeScript

Primary LanguageTypeScriptMIT LicenseMIT

Acorn API (typescript)

This project is inspired by AcornAPI which is an Acorn API written in Java.

Installation

npm install acorn-api --save

Example

Login

import { Acorn } from 'acorn-api-js';
const example = new Acorn();
example.basic.login('user', 'pass');

Get Registrations

example.course.getEligibleRegistrations();

Get Student Courses

example.course.getEnrolledCourses();
example.course.getCartedCourses();

Get Course Info (Can also use it to get waiting list rank for a waitlisted course)

int registrationIndex = 0;
const courseCode = "CSC373H1", sectionCode = "Y", courseSessionCode = "20175";
const course = example.getExtraCourseInfo(registrationIndex, courseCode, courseSessionCode, sectionCode);

Enroll a Course (Not yet tested)

int registrationIndex = 0;
const courseCode = "CSC373H1", sectionCode = "Y", lecSection = "LEC,5101";
const result = example.course.enroll(registrationIndex, courseCode, sectionCode, lecSection);

Get Current Transcript

const academicReport = example.academic.getAcademicHistory();