Skip to main content
Version: 2.0

Schedule

The Lessons controller provides the following endpoints:

  • /api/v2/Lessons/GetById?id={id}&type={type}&startTime={startTime}&endTime={endTime}
  • /api/v2/Lessons/GetByName?name={name}&type={type}&startTime={startTime}&endTime={endTime}

Where startTime and endTime are optional parameters. If they are not specified, you will get all the lessons available for the entity.

GetById

Gets lessons by the entity ID and type. Returns a list of Lesson objects.

Parameters:

NameTypeDescription
idintegerEntity ID
typeintegerEntity type. 0 for group, 1 for teacher, 2 for auditory. Default value is 0.
startTimeintegerOptional. Start time of the lesson. Format: UNIX seconds timestamp
endTimeintegerOptional. End time of the lesson. Format: UNIX seconds timestamp

Lesson object:

  {
"id": integer,
"brief": "string",
"title": "string",
"startTime": integer,
"endTime": integer,
"type": {
"id": integer,
"shortName": "string",
"fullName": "string",
"idBase": integer,
"type": "string"
},
"numberPair": integer,
"teachers": [
{
"id": integer,
"shortName": "string",
"fullName": "string",
"department": {
"id": integer,
"shortName": "string",
"fullName": "string"
},
"faculty": {
"id": integer,
"shortName": "string",
"fullName": "string"
}
}
],
"auditory": {
"id": integer,
"name": "string",
"floor": integer,
"hasPower": boolean,
"auditoryTypes": [
{
"id": integer,
"name": "string"
}
],
"building": {
"id": "string",
"shortName": "string",
"fullName": "string"
}
},
"groups": [
{
"id": integer,
"name": "string",
"direction": {
"id": integer,
"shortName": "string",
"fullName": "string"
},
"faculty": {
"id": integer,
"shortName": "string",
"fullName": "string"
}
}
]
}

Call example:

GetByName

Gets lessons by the entity name and type. Returns a list of Lesson objects.

Parameters:

NameTypeDescription
namestringEntity name. For teachers use their short name in a format of: Surname FN. MN.
typeintegerEntity type. 0 for group, 1 for teacher, 2 for auditory. Default is 0.
startTimeintegerOptional. Start time of the lesson. Format: UNIX seconds timestamp
endTimeintegerOptional. End time of the lesson. Format: UNIX seconds timestamp

Call example: