-
Notifications
You must be signed in to change notification settings - Fork 8
Requests and Responses
Welcome to the WebUntisSharp wiki.
This page will cover all calls you can make to the WebUntis server, and all responses you will get.
Take a look at all Requests and Responses, or at the official JSON PDF.
Create a new session and login with given credentials.
You will not need to login manually, the Constructors will take care of this.
await untis.Login(
string user, // Username for the WebUntis account
string password, // Password for the WebUntis account
string client // The Client (e.g. "ANDROID")
);
Logout/End the current Session.
An application should always logout as soon as possible to free system resources on the server.
You do not have to manually logout, when using a using
-block or calling the Dispose()
method.
await untis.Logout();
Get a List of all Teachers
List<Teacher> teachers = await untis.GetTeachers();
The Teacher
class:
int id;
string name;
string foreName;
string longName;
string foreColor;
string backColor;
Get a List of all Students
List<Student> students = await untis.GetStudents();
The Student
class:
int id;
string key;
string name;
string foreName;
string longName;
string gender;
Get a List of all Classes
List<Class> classes = await untis.GetClasses(
string schoolyearId // The ID of the school year to query Classes
);
The Class
class:
int id;
string name;
string longName;
string foreColor;
string backColor;
int did;
Get a List of all Subjects
List<Subject> subjects = await untis.GetSubjects();
The Subject
class:
int id;
string name;
string longName;
string foreColor;
string backColor;
Get a List of all Rooms
List<Room> rooms = await untis.GetRooms();
The Subject
class:
int id;
string name;
string longName;
string foreColor;
string backColor;
Get a List of all Departments
List<Department> departments = await untis.GetDepartments();
The Department
class:
int id;
string name;
string longName;
Get a List of all Holidays
List<Holiday> holidays = await untis.GetHolidays();
The Holiday
class:
int id;
string name;
string longName;
long startDate;
long endDate;
Get the current Timegrid
Timegrid timegrid = await untis.GetTimegrid();
The Timegrid
class:
int day; // day of the week, 1 = sunday, 2 = monday, .. 7 = saturday
TimeUnit[] timeUnits;
The TimeUnit
class:
long startTime;
long endTime;
Get the StatusData
StatusData statusData = await untis.GetStatusData();
The StatusData
class:
KeyValuePair<string, Colors> lstypes;
KeyValuePair<string, Colors> codes;
The Colors
class:
string foreColor;
string backColor;
Get the current Schoolyear
Schoolyear schoolyear = await untis.GetSchoolyear();
The Schoolyear
class:
int id;
string name;
long startDate;
long endDate;
Get all Schoolyears
List<Schoolyear> schoolyears = await untis.GetSchoolyears();
The Schoolyear
class:
int id;
string name;
long startDate;
long endDate;
Get a Timetable for a given Element
TimetableResult timetable = await untis.GetTimetableForElement(
int elementId, // The ID of the Element
int elementType, // The type of the Element (1 = klasse, 2 = teacher, 3 = subject, 4 = room, 5 = student)
long startDate, // The Start Date of the Timetable
long endDate // The End Date of the Timetable
);
The TimetableResult
class:
int id;
long date;
long startTime;
long endTime;
int[] kl;
int[] te;
int[] su;
int[] ro;
string lstype;
string code;
string lstext;
string statflags;
Get the last import time
System.DateTime importTime = await untis.GetLastImportTime();
Get the ID of a Person by Parameters
int personId = await untis.GetPersonId(
int personType, // The Type of Person | 2 = Teacher, 5 = Student
string surname, // The Surname of the Person to query
string forename, // The Forename of the Person to query
int birthdata // The Birthdata of the Person (Default is 0)
);
Get Substitutions
Substitution[] substitutions = await untis.GetSubstitution(
long startDate, // The Begin Date of the Substitutions to filter
long endDate, // The End Date of the Substitutions to filter
int departmentId = 0 // The ID of the Department (default = 0)
);
The Substitution
class:
//type of substitution:
//cancel = cancellation | subst = teacher substitution | add = additional period | shift = shifted period | rmchg = room change
string type;
ID id;
long date;
long startTime;
long endTime;
int[] kl;
int[] te;
int[] su;
int[] ro;
int[] txt;
Reschedule reschedule;
The ID
class:
int id;
int orgid;
The Reschedule
class:
int date;
int startTime;
int endTime;
Get ClassregEvents
Event[] events = await untis.GetClassRegEvents(
long startDate, // The Begin Date of the ClassregEvents to filter
long endDate // The End Date of the ClassregEvents to filter
);
The Event
class:
string studentid;
string surname;
string forname;
long date;
string subject;
string reason;
string text;
Get Exams
Exam[] exams = await untis.GetExams(
long startDate, // The Begin Date of the ClassregEvents to filter
long endDate, // The End Date of the ClassregEvents to filter
int examTypeId // The Exam Type ID
);
The Exam
class:
int[] classes;
int[] teachers;
int[] students;
int subject;
long date;
long startTime;
long endTime;
Get Exams Types (Not yet implemented)
Exam[] exams = await untis.GetExamTypes();
The Exam
class:
int[] classes;
int[] teachers;
int[] students;
int subject;
long date;
long startTime;
long endTime;