WebUntis icon indicating copy to clipboard operation
WebUntis copied to clipboard

teaching content

Open devskar opened this issue 1 year ago • 5 comments

I am trying to access the teaching content of my classes, but they don’t seem to be available. Does that feature not exist yet?

{ bkText: lesson.lstext, subsText: lesson.substText, infoText: lesson.info, remarkText: lesson.bkRemark, }

I tried all of these texts, but all are undefined for lessons with teaching content

devskar avatar Aug 23 '22 08:08 devskar

Yes, they are all optional. There are two possible options:

  1. There simply is no content
  2. Or you don't have permission to access it

Here you can find all available properties: https://github.com/SchoolUtils/WebUntis/blob/master/index.d.ts#L45

Properties with ? are optional and may not be available.

TheNoim avatar Aug 23 '22 08:08 TheNoim

But on the webapp I have access to the text so I should be able to access the information via api as well right?

devskar avatar Aug 23 '22 08:08 devskar

No, not really. Untis introduced a set of private APIs. Can you show an example of the available text? Maybe we implemented the private API.

TheNoim avatar Aug 23 '22 08:08 TheNoim

image I am trying to access this content, but the retrieved data looks like this:

{ id: 1212411, date: 20220822, startTime: 1135, endTime: 1305, kl: [ <> ], te: [ <> ], su: [ { id: 294, name: 'Sport', longname: 'Sport' } ], ro: [ <> ], lsnumber: 87100, activityType: 'Unterricht' } and all text values are undefined:

{ bkText: undefined, subsText: undefined, infoText: undefined, remarkText: undefined }

devskar avatar Aug 23 '22 08:08 devskar

Hm, it could be a new optional field which you need to explicit require in https://github.com/SchoolUtils/WebUntis/blob/master/index.js#L304 or it may simply not be available for the "public" API. You can try to find the query from which this field originates and add a new API path to this module. But without access to a Untis instance, which uses this field, there's nothing I can do.

TheNoim avatar Aug 23 '22 09:08 TheNoim