Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction 

The MyTimeTable

Table of Contents

Introduction 

The MyTimeTable API allows you to retrieve timetables and alter user's MyTimetable profiles. Most of the data in MyTimetable can be accessed using the API, and the possibilities are expanded continuously. The API is based on REST principles, and is currently on version 0. Requests can be done using the various available HTTP verbs (GET, POST, PUT and DELETE).

...

A student's timetable is made up of one or more individual timetables. These timetables are all of a certain type. The exact meaning of a type depends on the customer (see Customer-specific API information), but the table below gives an idea of the options:

TypeMeaning
studentPersonal timetable of a student (when available, most institutions do not have personal timetables available in their timetabling application).
staffPersonal timetable of a staff member.
moduleTimetable for a module or course.
posTimetable for a programme of study (group of modules).
posssTimetable for a programme of study (group of studentsets and associated modules). This is a different implementation that the pos type, and the exact type available depends on the institution.
studentsetTimetable for a certain group of students (usually the timetable for a class or study group).
studentsetgroupTimetable for a group of student sets (most customers use either studentset or studentsetgroup to the outside world).
moduleposTimetable for a certain module, but limited to the studentsets of a certain study programme. This is used if a module is shared between study programmes, but contains activities that are specific to a certain study programme.
userPersonal timetable for a user (can be both a student or a staff member).
locationTimetable for a certain (class)room.
zoneTimetable for a building or other grouping of rooms.
tagTimetable for all events that are marked with a specific tag.

The API gives the option to either query a user's complete personal timetable, based on his or her MyTimetable subscriptions, or a single timetable which is not based on a user's profile. The first option always requires a certain form of authentication, whereas the second option may be available without any authentication or only requires an API token. An example workflow for both scenarios:

...

A timetable always consists of a list of Event objects and is sorted by event start and end date. The events contain the following values:

NameDescription
activityDescriptionThe description of the activity, could be the course, module or activity name. This should be shown to the user as 'main description'.
moduleCodeSome customers have a separate module code available which is a (semi-) unique identifier for a certain course of module.
activityTypeNameThe name of the activity type this event belongs to. Key value which can be used to group and colour activities. Should not be shown to the end-user directly.
activityTypeDescriptionThe description of the activity type of this event. This value should be shown to the user and indicates whether the activity is a lecture, practical, exam, etc. Not all institutions provide (sensible) activity type information.
startDateStart date and time of the event. See below for the date format.
endDateEnd date and time of the event. See below for the date format.
studentSetsList of student sets (e.g., classes, groups) associated with the event.
locationsList of locations associated with the event (consists of identifier, name, key, capacity, url and avoidConcurrencyLocationIds (MyTimetable v2.5+, list of id's of locations that are also occupied if this location is occupied)).
staffMembersList of staff members associated with the event.
notesSome notes or additional information about the event, not all customers use this field.

timetableKeys

Contains the list of subscriptions (timetables) this event is part of (MyTimetable v2.5+)
highlightedTrue iff the event should be highlighted in the interface (reason is customer or department specific) (MyTimetable v2.5+)
tagsList of tags assigned to the event (MyTimetable 2.7+)

New fields may be added to objects without incrementing the version number. See API Documentation for details.

...

Input can be provided in the form of HTTP GET URL parameters (which should be URL encoded properly) or an HTTP POST/PUT body that is in application/x-www-form-urlencoded. Most parameters are optional, when this is not the case this is mentioned in the documentation. Dates and times can be specified in one of the following format:

  • 'today' or 'tomorrow' for the current or next day at 0:00;
  • Unix timestamp format (in milliseconds sinds 1970, so don't forget to multiply/divide by 1000);
  • ISO 8601 format (yyyy-MM-ddTHH:mm:ss±HH:mm): elements on the right side (time, time zone) are optional;
  • Legacy format (yyyy/MM/dd HH:mm): the time is optional.

Authentication and authorisation

...

Code Block
languagenone
{
    "timetableType": [
        "location", 
        "zone", 
        "module", 
        "student", 
        "staff", 
        "pos", 
        "posss", 
        "studentset", 
        "studentsetgroup", 
        "modulegroup", 
        "user",
		"tag"
    ]
}

/timetabletypesdetails   (since MyTimetable 3.0)

MethodGET

Description: Query all possible timetable types and return them including some details regards naming, whether or not they can include child timetables and their ordering in the menus. 

...

Description: Query a list of timetables for a specified type. The filters that can be specified can be retrieved using the /timetablefilters call. Returns a list of descriptions and identifiers. The identifiers can be used in subsequent calls to /timetables/{key} and /subscriptions/{key}.

Parameters

NameDescriptionDefault value
type(required)The type of the timetables, e.g. 'module'.-
limitThe maximum amount of records returned.0
offsetStarting position of the records returned (e.g. offset=5 skips the first 5 records).0
*Filter
Filter results on a specific filter. If the filtername, as returned by the /timetablefilters call is department, the parameter name is departmentFilter.-
qSearch string to filter results on (available from MyTimetable v2.3+).-
dDatasource to search in. Highest priority datasource by default (usually the most current database).Highest priority datasource

Example request URL

Code Block
languagenone
$base_url/api/v0/timetables?type=module 

...

Description: Query the schedule for the specified timetable identifier.

Parameters

NameDescriptionDefault value
key (required)
The key corresponding with the specific timetable, as retrieved using the /timetables call.-
fetchByUse 'hostKey' to retrieve the events by it's timetable host key instead of timetable key. Do not include this parameter to retrieve by timetable key. (MyTimetable v2.3 and higher)-
typeThe type of the timetable to retrieve, only used in combination with fetchBy=hostKey. 
startDate
The start date to retrieve events from, or 'today' for the current date at 0:00, or 'tomorrow' for tomorrow at 0:00, or none for the beginning of times.-
endDate
The end date to retrieve events till, or 'today' for the current date at 0:00, or 'tomorrow' for tomorrow at 0:00, or none for the end of times.-
limit
The maximum amount of records returned, 0 for no limit.0

Example request URLs

Code Block
languagenone
$base_url/api/v0/timetables/2011!module!49CBD432F01E8C5057B344E02604A710

...

/timetables/{key}/options    (since MyTimetable 3.1)

MethodGET

Description: Query the available options for the specified timetable. These options can be set on the subscription using the PUT call on a subscription. The allEquivalent boolean in the output will be true if any choice of options results in the same timetable.

Parameters

NameDescriptionDefault value
key (required)
The key corresponding with the specific timetable, as retrieved using the /timetables or /subscriptions call.-

Example request URLs

Code Block
languagenone
$base_url/api/v0/timetables/2011!module!49CBD432F01E8C5057B344E02604A710/options

...

/timetables/{parent}/{key}/options    (since MyTimetable 3.1)

MethodGET

Description: Query the available options for the specified child of a timetable. These options can be set on the subscription using the PUT call on a subscription. The allEquivalent boolean in the output will be true if any choice of options results in the same timetable.

Parameters

NameDescriptionDefault value
key (required)The key of the child subscription you wish to retrieve the options for.-
parent (required)
The key of the parent of the subscription.-

Example request URLs

Code Block
languagenone
$base_url/api/v0/timetables/2011!pos!49CBD432F01E8C5057B344E02604A710/6473C4D1BFD103FEDD5E0539C89DD334/options

...

Description: Query the personal timetable for the current user (as identified by the OAuth token or elevated API token).

Parameters

NameDescriptionDefault value
startDate
The start date to retrieve events from, or 'today' for the current date at 0:00, or 'tomorrow' for tomorrow at 0:00, or none for the beginning of times.-
endDate
The end date to retrieve events till, or 'today' for the current date at 0:00, or 'tomorrow' for tomorrow at 0:00, or none for the end of times.-
limit
The maximum amount of records returned, 0 for no limit.0
type
Specifies the type of the subscriptions to include when returning the timetable, can be specified multiple times, useful to exclude zone and location subscriptions when requesting the timetable. If not specified all subscriptions will be included in the result.-

Example request URL

Code Block
languagenone
$base_url/api/v0/timetable?startDate=2012-07-10&endDate=2012-07-10&type=location&type=zone

...

Description: Query all filters available for a specific timetable type. Using the results it is possible to filter the output of this call and of the /timetables call. Returns a list of possible filtertypes. For each type a list of possible filter descriptions and identifiers is provided.

Parameters

NameDescriptionDefault value
type (required)
The type of the timetables to retrieve the filters for.-
*Filter
Filter results on a specific filter. If the filtername, as returned by the /timetablefilters call is department, the parameter name is departmentFilter.-
dDatasource to search in. Highest priority datasource by default (usually the most current database).Highest priority datasource

 

Example request URL

Code Block
languagenone
$base_url/api/v0/timetablefilters?type=pos 

...

Description: Retrieves all subscriptions for the current user (as identified by the OAuth token or elevated API token). For older MyTimetable versions (pre-2.4) only the subscriptions of the currently selected datasource are returned. Newer MyTimetable versions return all subscriptions, use the database value in the returned subscriptions to determine which datasource a certain subscription belongs to. Since MyTimetable 3.0 the type name of a subscription is also returned.

Parameters:

NameDescriptionDefault value
type
Specifies the type of the subscriptions to include, can be specified multiple times, useful to exclude zone and location subscriptions when requesting a personal list of subscriptions. If not specified all subscriptions will be included in the result.-

Request URL

Code Block
languagenone
$base_url/api/v0/subscriptions

...

Description: Add a new subscription

Parameters

NameDescriptionDefault value
key (required)
The key of the timetable you wish to add.-

option

The id of the option to select for this timetable, retrieved using the /timetables/{key}/options call. Can be specified multiple times, or not specified to select all options (default). Should be specified as a form parameter. Available since MyTimetable 3.1.None (all options selected)

Example request URL 

Code Block
languagenone
$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6

...

Description: Delete a subscription.

Parameters

NameDescriptionDefault value
key (required)
The key of the subscription you wish to delete.-

Example request URL

Code Block
languagenone
$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6

...

Description: Edit a subscription. Use boolean values to trigger the subscription on or off.

Parameters

NameDescriptionDefault value
key (required)
The key of the subscription you wish to edit.-
state
Boolean value indicating the state of the subscription.false

Example request URL

Code Block
languagenone
$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6

...

/subscriptions/{key}/options     (since MyTimetable 3.1)

MethodPUT

Description: Set selected options of a subscription. Specifying all possible options will cause the list of selected options to be cleared, showing the complete timetable to the user.

Parameters

NameDescriptionDefault value
key (required)
The key of the subscription you with to set the options for.-
option (required)The id of the option, retrieved using the /timetables/{key}/options call. Can be specified multiple times. Should be specified as a form parameter.-

Example request URL 

Code Block
languagenone
$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6/options

...

Description: Clear the list of selected options of a subscription, which will cause all activities of the timetable to be shown to the user.

Parameters

NameDescriptionDefault value
key (required)
The key of the subscription you with to clear the options for.-

Example request URL

Code Block
languagenone
$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6/options

...

Description: Edit a subscription nested under a parent. Use boolean values to trigger the subscription on or off.

Parameters

NameDescriptionDefault value
key (required)The key of the subscription you wish to edit.-
parent (required)
The key of the parent of the subscription.-
state
Boolean value indicating the state of the subscription.false

Example request URL

Code Block
languagenone
$base_url/api/v0/subscriptions/2011!location!D2D0C6A8E334B242289FBAA7F69759C3/2011!module!49CBD432F01E8C5057B344E02604A773

...

/subscriptions/{parent}/{key}/options     (since MyTimetable 3.1)

MethodPUT

Description: Set selected options of a subscription nested under a parent. Specifying all possible options will cause the list of selected options to be cleared, showing the complete timetable to the user.

Parameters

NameDescriptionDefault value
key (required)
The key of the subscription you with to set the options for.-
parent (required)
The key of the parent of the subscription.-
option (required)The id of the option, retrieved using the /timetables/{parent}/{key}/options call. Can be specified multiple times. Should be specified as a form parameter.-

Example request URL 

Code Block
languagenone
$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6/646ADCA666D4A88402CA46C26A738046/options

...

Description: Clear the list of selected options of a subscription nested under a parent, which will cause all activities of the timetable to be shown to the user.

Parameters

NameDescriptionDefault value
key (required)
The key of the subscription you with to clear the options for.-
parent (required)
The key of the parent of the subscription.-

Example request URL

Code Block
languagenone
$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6/646ADCA666D4A88402CA46C26A738046/options

...

Code Block
languagenone
{
    "feedUrl": "http://myuniversity/ical?eu=FKW92Fawier&t=556cf8a1-704a-4997-bc4d-5acf395eccaf",
    "username": "testuser"
}

/weeklabels   (deprecated since MyTimetable 2.7, replaced by: /weeklabelmaps)

Method: GET

Description: Query the weeklabels. This provides custom labels for the weeks when available. The response includes a value (the custom label) and a week (year - 1900 + the ISO week number).

...

Code Block
languagejs
{
    weeklabel: [
        {
            "week": 11223,
            "value": "23"
        },
        {
            "week": 11224,
            "value": "24"
        }
    ]
}

/weeklabelmaps   (since MyTimetable 2.7)

MethodGET

Description: Query the weeklabel maps. This provides the available maps with custom labels for the weeks. Per weeklabel map, the response includes a key and a boolean which indicates whether the map is the default weeklabel map for the requested user.

...

Code Block
languagejs
{
    "weeklabelmaps": [
        {
            "key": "SYLLABUS",
            "isDefault": true
        }
    ]
}

/weeklabelmaps/{key}   (since MyTimetable 2.7)

MethodGET

Description: Retrieve the specified weeklabel map. This provides the key, a boolean which indicates if this is the default weeklabel map for the requested user and the actiual map with custom labels for the weeks.

Parameters

NameDescriptionDefault value
key (required)
The key of the weeklabel you wish to retrieve.-

Example request URL

Code Block
languagenone
$base_url/api/v0/weeklabelmaps/SYLLABUS

...

Code Block
languagejs
{
    "key": "SYLLABUS",
    "isDefault": true,
    "weeklabels": [
        {
            "year": 2014,
            "week": 4,
            "description": "wk 4"
        },
        {
            "year": 2014,
            "week": 5,
            "description": "wk 5"
        }
    ]
}

/databases    (deprecated since MyTimetable 3.1, replaced by: /databasedetails)

MethodGET

Description: Query the available datasources, see API Documentation for more information.

Parameters: none

Request URL. For MyTimetable 3.1+, please use the /databasedetails call, which also provides the labels of the databases.

Parameters: none

Request URL

Code Block
languagenone
$base_url/api/v0/databases

...

Code Block
languagenone
{
    "database": [
        "2011"
    ]
}

/databasedetails   (since MyTimetable 3.1)

MethodGET

Description: Query the available datasources, see API Documentation for more information. The key (to be used in the query string of other calls) and the label are returned.

Parameters: none

Request URL

Code Block
languagenone
$base_url/api/v0/databasedetails

Example response body

Code Block
languagenone
{
    "databases": [
        {
            "key": "2015",
            "label": "2015/2016"
        },
        {
            "key": "2016",
            "label": "2016/2017"
        },
        {
            "key": "TimetableDB",
            "label": "Custom"
        }
    ]
}

/eventtypegroups   (since MyTimetable 3.0)

Method: GET

Description: Query the event type groups and event filtering settings.

...

Code Block
languagenone
$base_url/api/v0/eventtypegroups

Request Content-Type

application/x-www-form-urlencoded

Example request body

Code Block
languagenone
eventTypeGroups%5BExcursie%5D%5BisFiltered%5D=true&eventTypeGroups%5BHoorcollege%5D%5BisFiltered%5D=false&eventTypeGroups%5BOther%5D%5BisFiltered%5D=false

...