Class WebUntis

Hierarchy (view full)

Constructors

  • Parameters

    • school: string

      The school identifier

    • username: string
    • password: string
    • baseurl: string

      Just the host name of your WebUntis (Example: mese.webuntis.com)

    • Optional identity: string = 'Awesome'

      A identity like: MyAwesomeApp

    • Optional disableUserAgent: boolean = false

      If this is true, axios will not send a custom User-Agent

    Returns WebUntis

Properties

anonymous: boolean
axios: AxiosInstance
baseurl: string
cookies: string[]
id: string
password: string
school: string
schoolbase64: string
sessionInformation: null | SessionInformation
username: string
TYPES: typeof WebUntisElementType = WebUntisElementType

Methods

  • Private

    Returns string

  • Returns void

  • Private

    Get JWT Token

    Parameters

    • validateSession: boolean = true

    Returns Promise<string>

  • Private

    Make a JSON RPC Request with the current session

    Type Parameters

    • Response = Record<string, any>

    Parameters

    • method: string
    • Optional parameter: Record<string, any> = {}
    • Optional validateSession: boolean = true

      Whether the session should be checked first

    • Optional url: string = ...

    Returns Promise<Response>

  • Private

    Parameters

    • id: string | number
    • type: number
    • Optional startDate: null | Date
    • Optional endDate: null | Date
    • validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Returns all the Lessons where you were absent including the excused one!

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional excuseStatusId: number = -1
    • Optional validateSession: boolean = true

    Returns Promise<Absences>

  • Get all classes known by WebUntis

    Parameters

    • Optional validateSession: boolean = true
    • schoolyearId: number

    Returns Promise<Klasse[]>

  • Get the current school year

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<SchoolYear>

  • Get all departments known by WebUntis

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Department[]>

  • Get Exams for range

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • klasseId: number = -1
    • withGrades: boolean = false
    • Optional validateSession: boolean = true

    Returns Promise<Exam[]>

  • Get all holidays known by WebUntis

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Holiday[]>

  • TODO: Find out what type this function returns

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional validateSession: boolean = true

    Returns Promise<any[]>

  • Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional validateSession: boolean = true

    Returns Promise<Homework[]>

  • Get Inbox

    Parameters

    • validateSession: boolean = true

    Returns Promise<Inbox>

  • Get the time when WebUntis last changed its data

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<number>

  • Get the latest WebUntis Schoolyear

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<SchoolYear>

  • Get News Widget

    Parameters

    • date: Date
    • Optional validateSession: boolean = true

    Returns Promise<NewsWidget>

    see index.d.ts NewsWidget

  • Get the Timetable of your class for the given day Note: You can't use this with anonymous login

    Parameters

    • date: Date
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the Timetable of your class for a given Date range Note: You can't use this with anonymous login

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the Timetable of your class for today Note: You can't use this with anonymous login

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get your own Timetable for the given day Note: You can't use this with anonymous login

    Parameters

    • date: Date
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get your own timetable for a given Date range Note: You can't use this with anonymous login

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get your own Timetable for the current day Note: You can't use this with anonymous login

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the timetable for the current week for the current element from the web client API.

    Parameters

    • date: Date

      one date in the week to query

    • Optional formatId: number = 1

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

    • Optional validateSession: boolean = true

    Returns Promise<WebAPITimetable[]>

  • Returns a URL to a unique PDF of all the lessons you were absent

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional validateSession: boolean = true
    • Optional excuseStatusId: number = -1
    • Optional lateness: boolean = true
    • Optional absences: boolean = true
    • Optional excuseGroup: number = 2

    Returns Promise<string>

  • Get all known rooms by WebUntis

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Room[]>

  • Get all WebUntis Schoolyears

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<SchoolYear[]>

  • Get all status data known by WebUntis

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<StatusData>

  • Get all known students by WebUntis

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Student[]>

  • Get all known Subjects for the current logged-in user

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Subject[]>

  • Get all known teachers by WebUntis

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Teacher[]>

  • Get the timegrid of current school

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Timegrid[]>

  • Get the timetable for a specific day for a specific element.

    Parameters

    • date: Date
    • id: number
    • type: number
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the timetable for a given Date range for specific element

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • id: number
    • type: number
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the timetable of today for a specific element.

    Parameters

    • id: number
    • type: number
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the timetable for the current week for a specific element from the web client API.

    Parameters

    • date: Date

      one date in the week to query

    • id: number

      element id

    • type: number

      element type

    • Optional formatId: number = 1

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

    • Optional validateSession: boolean = true

    Returns Promise<WebAPITimetable[]>

  • Login with your credentials

    Notice: The server may revoke this session after less than 10min of idle.

    Untis says in the official docs:

    An application should always log out as soon as possible to free system resources on the server.

    Returns Promise<SessionInformation>

  • Logout the current session

    Returns Promise<boolean>

  • Checks if your current WebUntis Session is valid

    Returns Promise<boolean>

  • Convert a JS Date Object to a WebUntis date string

    Parameters

    • date: Date

    Returns string

  • Converts the untis date string format to a normal JS Date object

    Parameters

    • date: string

      Untis date string

    • Optional baseDate: Date = ...

      Base date. Default beginning of current day

    Returns Date

    Static

  • Convert a untis time string to a JS Date object

    Parameters

    • time: string | number

      Untis time string

    • Optional baseDate: Date = ...

      Day used as base for the time. Default: Current date

    Returns Date

    Static

Generated using TypeDoc