SchoolUtils / WebUntis

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

Just a few questions #29

Closed luwol03 closed 3 years ago

luwol03 commented 3 years ago

Hello,

I have got the api docs with a email to helpdesk. And now I have a few questions.

  1. What version of the documentation you're using? And how much pages you have? (Mine is from 20.09.2018 and has 19 pages)

  2. In mine there is nothing about getting homeworks and a few other stuff. Only json rpc and nothing about a rest API. Did you figured out the rest api yourself?

  3. The guy from the untis team, who send me the documentation said:

    The query interval of your program must NOT be less than 60 minutes. Otherwise the query will be blocked by the system.

Have you any experience with testing your program? Did you got blocked?

  1. And in my sheet I can't find anything about the secret authentication and anonymous login. Did you figured out this also yourself?

Best regards.

TheNoim commented 3 years ago

Hi,

  1. What version of the documentation you're using? And how much pages you have? (Mine is from 20.09.2018 and has 19 pages)

I have the same version.

  1. In mine there is nothing about getting homeworks and a few other stuff. Only json rpc and nothing about a rest API. Did you figured out the rest api yourself?

Figured it out by myself.

  1. The guy from the untis team, who send me the documentation said:

The query interval of your program must NOT be less than 60 minutes. Otherwise the query will be blocked by the system. Have you any experience with testing your program? Did you got blocked?

I think they don't have a blocking system which triggers that early. Never got blocked. Just don't abuse it and you should be fine. If there servers can not handle 2 request every hour, then they probably did something wrong while developing WebUntis.

  1. And in my sheet I can't find anything about the secret authentication and anonymous login. Did you figured out this also yourself?

Yes, again. I figured it out by myself. Nothing there in the official documentation.

luwol03 commented 3 years ago

Ok, thank you very much for awnsering. I like your api wrapper.

luwol03 commented 3 years ago

Do you know, if there is also something to get all teacher who theaches me in which lesson?

NYC00kie commented 3 years ago

Do you know, if there is also something to get all teacher who theaches me in which lesson?

That should be in the time table.

TheNoim commented 3 years ago

https://github.com/TheNoim/WebUntis/blob/master/index.d.ts#L49

luwol03 commented 3 years ago

That's funny, could it be that my school blocks fetching also the teacher? This is one lesson json object Im getting.

{
  "id": 357397,
  "date": 20200922,
  "startTime": 955,
  "endTime": 1040,
  "kl": [
    {
      "id": 280,
      "name": "11",
      "longname": " (314)"
    },
    {
      "id": 285,
      "name": "11",
      "longname": "(320)"
    }
  ],
  "su": [
    {
      "id": 1,
      "name": "KR",
      "longname": "Kath. Relogion"
    }
  ],
  "ro": [
    {
      "id": 44,
      "name": "314",
      "longname": "(9d)"
    }
  ],
  "lsnumber": 9800,
  "activityType": "Unterricht"
}
TheNoim commented 3 years ago

That's funny, could it be that my school blocks fetching also the teacher? This is one lesson json object Im getting.

It could be. Can you make a screenshot of some lessons on the webuntis page?

luwol03 commented 3 years ago

image It's funny, because on the web untis page I can see my teachers, but on the mobile app i can't. Could it be that webuntis fetch the data an other way like the mobile app? And the mobile app use the offfical api?

TheNoim commented 3 years ago

Currently, there are three known apis to me:

  1. The official
  2. WebAPI (Used by the webpage)
  3. App API

However, this is the first time that I encountered that some api is missing some data. I mean, if some api is returning the data, we should be able to get it somehow. But we need to modify the api client.

luwol03 commented 3 years ago

how do you recommend the login management? just login for one api call and then log out or leave the session valid and not logout and validate the session before every api call?

TheNoim commented 3 years ago

how do you recommend the login management? just login for one api call and then log out or leave the session valid and not logout and validate the session before every api call?

If you really know you only do one request, you can logout. However, a session is only valid for 15 minutes. So, if you do more than one request in 15 minutes, you can just leave it. The client will refresh the session by itself.