Table of Contents |
---|
Introduction
...
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
...
- The API-token is a secret, and should only be used in back-end services. Do not include it in your end-user application.
- Enable GZIP-compression in your API library. Support for non-compressed responses may be dropped in the future.
- Make sure your client supports TLS v1.2, older versions may not be disabled in the futureavailable.
- Do not cache data for long periods of time (or at all), but do make sure end-users cannot trigger useless API requests (e.g., cache while the user is in the same view, and do not let the user refresh 100's of times by simply spamming a button).
- The schema may change as fields may be added. Be sure to ignore unknown fields in your data mapper.
- Do not 'scrape' the API and store data locally. It causes a high load and stale data.
- Do not perform unnecessarily large requests or a large number of requests. E.g., if you want to show the upcoming 5 activities of a location, just request the upcoming 5 activities and not the timetable for the whole year. Also, do not refresh that view every minute, as the timetable will not change every minute.
...
Code Block | ||
---|---|---|
| ||
{ "timetableType": [ "location", "zone", "module", "student", "staff", "pos", "posss", "studentset", "studentsetgroup", "modulegroup", "user", "tag" ] } |
/timetabletypesdetails (since MyTimetable 3.0)
Method: GET
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.
...
/timetables/{key}/options (since MyTimetable 3.1)
Method: GET
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.
...
/timetables/{parent}/{key}/options (since MyTimetable 3.1)
Method: GET
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.
...
/subscriptions/{key}/options (since MyTimetable 3.1)
Method: PUT
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.
...
/subscriptions/{parent}/{key}/options (since MyTimetable 3.1)
Method: PUT
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.
...
Code Block | ||
---|---|---|
| ||
{ "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 | ||
---|---|---|
| ||
{ weeklabel: [ { "week": 11223, "value": "23" }, { "week": 11224, "value": "24" } ] } |
/weeklabelmaps (since MyTimetable 2.7)
Method: GET
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 | ||
---|---|---|
| ||
{ "weeklabelmaps": [ { "key": "SYLLABUS", "isDefault": true } ] } |
/weeklabelmaps/{key} (since MyTimetable 2.7)
Method: GET
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.
...
Code Block | ||
---|---|---|
| ||
{ "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)
Method: GET
Description: Query the available datasources, see API Documentation for more information. For MyTimetable 3.1+, please use the /databasedetails
call, which also provides the labels of the databases.
...
Code Block | ||
---|---|---|
| ||
{ "database": [ "2011" ] } |
/databasedetails (since MyTimetable 3.1)
Method: GET
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.
...
Code Block | ||
---|---|---|
| ||
{ "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 | ||
---|---|---|
| ||
$base_url/api/v0/eventtypegroups |
Request Content-Type
application/x-www-form-urlencoded
Example request body
Code Block | ||
---|---|---|
| ||
eventTypeGroups%5BExcursie%5D%5BisFiltered%5D=true&eventTypeGroups%5BHoorcollege%5D%5BisFiltered%5D=false&eventTypeGroups%5BOther%5D%5BisFiltered%5D=false |
...
204 (No content), 403 (Forbidden) if filtering is disabled.
/terms (since MyTimetable 3.4)
Method: GET
Description: Query the available terms. Returns a list of terms, each containing of a unique id, a key (may be null), a name and a list of date ranges.
...