Table of Contents |
---|
...
Input can be provided in the form of HTTP GET URL parameters 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 should be specified in the following format (which is totally inconsistent with the rest of our API, we will fix this in the next version): YYYY/MM/DD HH:MM
. The time part is optional and will be regarded as 0:00 if not specified.
Authentication and authorisation
...
During a year rollover, multiple databases with timetabling data may be available. By specifying a GET parameter d
, it is possible to select a certain database for the request. The list of possible databases can be retrieved with the API Documentation call. If no database is specified, the default database will be used, which is usually the most sensible option. In the future, the API will remove the need to specify a database with a request and will transparently query multiple databases when necessary.
Resources
/timetabletypes
Method: GET
Description: Query all possible timetable types, these types serve as input for the /timetables, /timetable and /timetablefilters calls. See API Documentation for a discussion on the meaning of the types.Method: GET
Parameters: none
Request URL
...
Code Block | ||
---|---|---|
| ||
{ "timetableType": [ "location", "zone", "module", "student", "staff", "pos", "posss", "studentset", "studentsetgroup", "modulegroup", "user" ] } |
/timetables
Method: GET
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}.
Method: GET
Parameters
Name | Description | Default value |
type (required) | the The type of the timetables, e.g. 'module'. | - |
limit | the The maximum amount of records returned. | 0 |
offset | starting Starting position of the records returned (e.g. offset=5 skips the first 5 records). | 0 |
departmentFilter | filter Filter results on a specific department. | - |
departmentGroupFilter | filter Filter results on a specific department group. | - |
posFilter | filter Filter results on a specific pos. | - |
zoneFilter | filter Filter results on a specific zone. | - |
Example request URL
Code Block | ||
---|---|---|
| ||
$base_url/api/v0/timetables?type=module |
...
Code Block | ||
---|---|---|
| ||
[ { "description": "VMT for Informatics", "value": "2011!module!49CBD432F01E8C5057B344E02604A710" } ] |
/timetables/{key}
Method: GET
Description: Query the schedule for the specified timetable identifier.
Method: GET
Parameters
Name | Description | Default value |
key (required) | the The key corresponding with the specific timetable, as retrieved using the /timetables call. | - |
startDate | the 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 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 The maximum amount of records returned, 0 for no limit. | 0 |
Example request URL
Code Block | ||
---|---|---|
| ||
$base_url/api/v0/timetables/2011!module!49CBD432F01E8C5057B344E02604A710 |
...
Code Block | ||
---|---|---|
| ||
[ { "activityDescription": "VMT for Informatics", "activityTypeDescription": "Lecture", "activityTypeName": "Class", "endDate": 1341930600000, "locations": [ { "capacity": 18, "id": "D2D0C6A8E334B242289FBAA7F69759C3", "key": "#SPLUS9759C3", "name": "B3.022" } ], "moduleCode": "#SPLUS04A710", "notes": null, "staffMembers": [ "Mr. Moore (Moo)" ], "startDate": 1341919800000, "studentSets": [ "BI group 1A", "BI group 1B" ] } ] |
/timetable
Method: GET
Description: Query the personal timetable for the current user (as identified by the OAuth token or elevated API token).
Method: GET
Parameters
Name | Description | Default value |
startDate | the 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 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 The maximum amount of records returned, 0 for no limit. | 0 |
type | Specifies the type of the timetables, e.g. 'module'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 | ||
---|---|---|
| ||
$base_url/api/v0/timetable?startDate=2012/07/10&endDate=2012/07/10 |
...
&type=location&type=zone |
Example response body
Code Block | ||
---|---|---|
| ||
{ "activityDescription": "System biology", "activityTypeDescription": "Lecture", "activityTypeName": "Class", "endDate": 1341916200000, "locations": [ { "capacity": 24, "id": "D2D0C6A8E334B242289FBAA7F69759BB", "key": "#SPLUS9759BB", "name": "G3.104" }, { "capacity": 24, "id": "D2D0C6A8E334B242289FBAA7F69759BC", "key": "#SPLUS9759BC", "name": "G3.110" } ], "moduleCode": "#SPLUS969C58", "notes": null, "staffMembers": [ "Mr. Martinez (Maz)", "Ms. Adams (Ada)" ], "startDate": 1341909000000, "studentSets": [ "BI group 3A" ] } |
/timetablefilters
Method: GET
Description: Query all filters available for a specific timetable type.
Method: GET
Parameters
...
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
Name | Description | Default value |
type (required) | the type of the timetable | - |
departmentFilter | Filter results on a specific department. | - |
departmentGroupFilter | Filter results on a specific department group. | - |
zoneFilter | Filter results on a specific zone. | - |
Example request URL
Code Block | ||
---|---|---|
| ||
$base_url/api/v0/timetablefilters?type=pos |
...
Code Block | ||
---|---|---|
| ||
{ "filterattribute": [ { "option": [ { "name": " Faculty of Informatics", "value": "646ADCA666D4A88402CA46C26A73803C" }, { "name": " Faculty of Law", "value": "646ADCA666D4A88402CA46C26A738046" } ], "type": "department" } ] } |
...
]
} |
/subscriptions
Method: GET
Description: Retrieves all subscriptions for the current user (as identified by the OAuth token or elevated API token).
Parameters: none
Request URL
Code Block | ||
---|---|---|
| ||
$base_url/api/v0/subscriptions |
Example response Body
Code Block | ||
---|---|---|
| ||
TODO |
Method: DELETE
Description: Delete all subscriptions
Parameters: none
Example response bodyRequest URL
Code Block | ||
---|---|---|
| ||
$base_url/api/v0/subscriptions |
Response code: 204 (No content)
/subscriptions/{key}
Method: POST
...
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).
Method: GET
Parameters: none
...
Description: Query the available databases, see API Documentation for more information.
Method: GET
Parameters: none
...