Versions Compared

Key

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

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).

The API documentation uses the variable $base_url to refer to the base URL of MyTimetable. This URL depends on the customer and can be found on the Customer-specific API information page.

Not all MyTimetable sites have enabled API access. Some customers choose to enable API access only for certain trusted applications. Please contact us if you have questions about the API or if you would like to receive an access token for a certain API.

Data structure

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.

...

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).

The API documentation uses the variable $base_url to refer to the base URL of MyTimetable. This URL depends on the customer and can be found on the Customer-specific API information page.

Not all MyTimetable sites have enabled API access. Some customers choose to enable API access only for certain trusted applications. Please contact us if you have questions about the API or if you would like to receive an access token for a certain API.

Data structure

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.

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:

...

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
{
    "filterattribute": [
        {
            "option": [
                {
                    "name": " Faculty of Informatics", 
                    "value": "646ADCA666D4A88402CA46C26A73803C"
                }, 
                {
                    "name": " Faculty of Law", 
                    "value": "646ADCA666D4A88402CA46C26A738046"
                }
            ], 
            "type": "department"
        }
    ]
}

/subscriptions

MethodGET

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.

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

Example response Body

Code Block
languagenone

	{
 		"namekey": " Faculty of Law", 
                    "value": "646ADCA666D4A88402CA46C26A738046"
                }
            ], 
            "type": "department"
        }
    ]
}

/subscriptions

MethodGET

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.

...

"2011!module!49CBD432F01E8C5057B344E02604A711",
		"description":"Basic chemical reactions",
		"childSubscriptions":[],
		"enabled":false,
		"removable":true
	}
]


MethodDELETE

Description: Delete all subscriptions

Parameters: none

Request URL

Code Block
languagenone
$base_url/api/v0/subscriptions

Response code: 204 (No content)

/subscriptions/{key}

MethodPOST

Description: Add a new subscription

Parameters

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

Example request URL 

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

Response code: 204 (No content)

 

MethodDELETE

Description: Delete a subscription.

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 resultkey (required)
The key of the subscription you wish to delete.-

Request Example request URL

Code Block
languagenone
$base_url/api/v0/subscriptions

Example response Body

Code Block
languagenone
[ 
	{
		"key":"2011!module!49CBD432F01E8C5057B344E02604A711",
		"description":"Basic chemical reactions",
		"childSubscriptions":[],
		"enabled":false,
		"removable":true
	}
]/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6

Response code: 204 (No content)


MethodDELETEPUT

Description: Delete all subscriptions

Parameters: none

Request 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

Response codeCode204 (No content)

/subscriptions/{parent}/{key}

MethodPOSTPUT

Description: Add a new subscriptionEdit 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 timetable you wish to add.-

...

(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!pos!0F2C927DF37F3A2BEF1F1713768E4EE6location!D2D0C6A8E334B242289FBAA7F69759C3/2011!module!49CBD432F01E8C5057B344E02604A773

Response codeCode204 (No content)

 

MethodDELETE

/user

Description: Delete a subscription.

Parameters

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

Example request Query information on the current user. Currently this returns the username and the iCalendar feed URL for the current user.

MethodGET

Parameters: none

Request URL

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

Response code: 204 (No content)

MethodPUT

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

...

user

Example response body

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)

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).

MethodGET

Parameters: none

Request URL

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

Response Code: 204 (No content)

/subscriptions/{parent}/{key}

MethodPUT

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

Response Code: 204 (No content)

/user

...

weeklabels

Example response body

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

/weeklabelmaps   (since MyTimetable 2.7)

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.

MethodGET

Parameters: none

...

Code Block
languagenone
$base_url/api/v0/userweeklabelmaps

Example response body

Code Block
languagenonejs
{
    "feedUrlweeklabelmaps": "http://myuniversity/ical?eu=FKW92Fawier&t=556cf8a1-704a-4997-bc4d-5acf395eccaf",[
        {
            "key": "SYLLABUS",
            "usernameisDefault": "testuser" true
        }
    ]
}

...

/weeklabelmaps/{key}   (since MyTimetable 2.7)

Description: Query Retrieve the weeklabelsspecified weeklabel map. 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)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.

MethodGET

Parametersnone

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

Request URL

Code Block
languagenone
$base_url/api/v0/weeklabels

Example response body

Code Block
languagenone
{weeklabelmaps/SYLLABUS

Example response body

Code Block
languagejs
{
    "key": "SYLLABUS",
    "isDefault": true,
    weeklabel"weeklabels": [
        {
            "year": 2014,
            "week": 112234,
            "valuedescription": "23wk 4"
        },
        {
            "year": 2014,
            "week": 112245,
            "valuedescription": "24wk 5"
        }
    ]
}

/databases

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

...