Versions Compared

Key

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

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

MethodGET

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

Parameters: none

Request URL

...

Code Block
languagenone
{
    "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

NameDescriptionDefault value
type(required)the The type of the timetables, e.g. 'module'.-
limitthe The maximum amount of records returned.0
offsetstarting 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
languagenone
$base_url/api/v0/timetables?type=module 

...

Code Block
languagenone
[
    {
    	"description": "VMT for Informatics", 
    	"value": "2011!module!49CBD432F01E8C5057B344E02604A710"
    }
]

/timetables/{key}

Method: GET

Description: Query the schedule for the specified timetable identifier.

Method: GET

Parameters

NameDescriptionDefault 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
languagenone
$base_url/api/v0/timetables/2011!module!49CBD432F01E8C5057B344E02604A710

...

Code Block
languagenone
[
   {
        "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

NameDescriptionDefault 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
languagenone
$base_url/api/v0/timetable?startDate=2012/07/10&endDate=2012/07/10

...

&type=location&type=zone

Example response body

Code Block
languagenone
{
        "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

MethodGET

Description: Query all filters available for a specific timetable type.  

MethodGET

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

NameDescriptionDefault 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
languagenone
$base_url/api/v0/timetablefilters?type=pos 

...

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

Parameters: none

Request URL

Code Block
languagenone
$base_url/api/v0/subscriptions

Example response Body

Code Block
languagenone
TODO


MethodDELETE

Description: Delete all subscriptions

Parameters: none

Example response bodyRequest URL

Code Block
languagenone
$base_url/api/v0/subscriptions

Response code: 204 (No content)

/subscriptions/{key}

MethodPOST

...

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

...

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

MethodGET

Parameters: none

...