SchoolUtils / WebUntis

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

Problem with the returns of getTimetableForWeek #100

Open bhasim1 opened 1 year ago

bhasim1 commented 1 year ago

In the docs (https://webuntis.noim.me/classes/WebUntisAnonymousAuth.html#getTimetableForWeek) is says:

Optional formatId: number = 1

set to 1 to include teachers, 2 omits the teachers in elements response

But I get no teachers in the return. Can I just use the getTimetableForRange, pass in the range of the week and get a correct response from there?

luwol03 commented 1 year ago

Do you see teachers when using webuntis.com in your browser? This extra method was implemented, because some schools prevented students from getting teacher information via official API, but show teachers on webuntis.com. So this method uses what webuntis.com uses in the background instead of the API. So yes, if the other method works for you, I would prefere that with the according range.

bhasim1 commented 1 year ago

So I see no teacher in the browser, but with getTimetableForToday

bhasim1 commented 1 year ago

So I have tested it and it works with getTimetableForRange. So the problem is that my school denied access to getTimetableForWeek, but everything else works normal? nice

luwol03 commented 1 year ago

So I see no teacher in the browser, but with getTimetableForToday

That's why you dont get the teachers via the week method. This week method exactly emulates what happens on webuntis.com in the back.

So I have tested it and it works with getTimetableForRange. So the problem is that my school denied access to getTimetableForWeek, but everything else works normal? nice

Yeah, seems like your school is doing the opposite of my 😆 .