SchoolUtils / WebUntis

JavaScript WebUntis API Client
https://webuntis.noim.me/
MIT License
166 stars 21 forks source link

What is the base url for the school? #99

Closed tevzselcan closed 1 year ago

tevzselcan commented 1 year ago

Im trying to get the timetables with this code, but I don't know what the base url is for myschool, the current code:

import { WebUntisAnonymousAuth, WebUntisElementType } from "webuntis";

const untis = new WebUntisAnonymousAuth(
  "SC-Celje",
  "https://ajax.webuntis.com/WebUntis/?school=sc-celje"
);

await untis.login();
const classes = await untis.getClasses();
const timetable = await untis.getTimetableForToday(
  classes[10].id,
  WebUntisElementType.CLASS
);
console.log(timetable);
TheNoim commented 1 year ago

The baseurl for you is ajax.webuntis.com. However, I don't think your instance supports anonymous auth.

tevzselcan commented 1 year ago

Thanks, got it working with that :)