Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

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 

Output format

The resources support both JSON and XML. By default, the returned format depends on the HTTP Accept header. Use application/json for JSON and application/xml for XML. It is also possible to specify the output format in the URL, by appending .json or .xml to the resource name, before the query string.

Authentication and authorisation

To set up OAuth, follow these steps:

  1. Visit http://demo.eveoh.nl/oauth/authorize?response_type=code&client_id=test&redirect_uri=http://localhost
  2. You will be prompted to log in. After logging in the application will request for your permission to access your personal timetable. Click Allow.
  3. After being redirected the URL will contain ?code=XXXXXX. Copy this code.
  4. Open a Terminal window and enter the following command (replace XXXXXX with your personal code from step 3): 

    curl -d 'grant_type=authorization_code&client_id=test&client_secret=test&code=XXXXXX&redirect_uri=http://localhost' http://demo.eveoh.nl/oauth/token
  5. The command will return an access token. This token will allow you to request resources from the API. 

WADL

A machine readable XML based description of the API can be viewed using the following url:

$base_url/api/v0?_wadl

Resources

/timetables

Description: Query all timetables with a specified type.

Type: GET

Parameters

typethe type of the timetables, e.g. 'module'
limitthe maximum amount of records returned
offsetstarting position of the records returned (e.g. offset=5 skips the first 5 records)
departmentFilterfilter on a specific department
posFilterfilter on a specific pos
zoneFilterfilter on a specific zone

Request URL

$base_url/api/v0/timetables?type=module 

Response Body

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

/timetables/{key}

Description: Query all timetables corresponding with a specific timetable.

Type: GET

Parameters

keythe key corresponding with the specific timetable
startDatethe start date for the timetable
endDatethe end date for the timetable
limitthe maximum amount of records returned (default = 25)

Request URL

$base_url/api/v0/timetables/2011!module!49CBD432F01E8C5057B344E02604A710

Response Body

[
   {
        "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

Description: Query all timetables within a specific timerange.

Type: GET

Parameters

startDatethe start date for the timetable
endDatethe end date for the timetable
limitthe maximum amount of records returned
typethe type of the timetables, e.g. 'module'

Request URL

$base_url/api/v0/timetable?startDate=2012/07/10&endDate=2012/07/10

Response Body

{
        "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"
        ]
}

/timetabletypes

Description: Query all possible timetable types. 

Type: GET

Parameters: none

Request URL

$base_url/api/v0/timetabletypes

Response Body

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

/timetablefilters

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

Type: GET

Parameters

typethe type of the timetable
departmentFiltera specific filter

Request URL

$base_url/api/v0/timetablefilters?type=pos 

Response Body

{
    "filterattribute": [
        {
            "option": [
                {
                    "name": " Faculty of Informatics", 
                    "value": "646ADCA666D4A88402CA46C26A73803C"
                }, 
                {
                    "name": " Faculty of Law", 
                    "value": "646ADCA666D4A88402CA46C26A738046"
                }
            ], 
            "type": "department"
        }
    ]
}

/databases

Description: Query the available databases.

Type: GET

Parameters: none

Request URL

$base_url/api/v0/databases

Response Body

{
    "database": [
        "2011"
    ]
}

/weeklabels

Description: Query the weeklabels.

Type: GET

Parameters: none

Request URL

$base_url/api/v0/weeklabels

Response Body

{
     "value": "23", 
     "week": 11223
}

/subscriptions

Type: DELETE

Description: Delete all subscriptions

Parameters: none

Request URL

$base_url/api/v0/subscriptions

/subscriptions/{key}

Type: POST

Description: Add a new subscription

Parameters

keythe key of the subscription you wish to add

Request URL 

$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6

Response code: 204 (No content)

 

Type: DELETE

Description: Delete a subscription.

Parameters

keythe key of the subscription you wish to delete

Request URL

$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6

Response code: 204 (No content)


Type: PUT

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

Parameters

keythe key of the subscription you wish to edit
stateboolean value indicating the state of the subscription

Request URL

$base_url/api/v0/subscriptions/2011!pos!0F2C927DF37F3A2BEF1F1713768E4EE6?state=false

Response Code: 204 (No content)

/subscriptions/{parent}/{key}

Type: PUT

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

Parameters

keythe key of the subscription you wish to edit
parentthe key of the parent of the subscription
stateboolean value indicating the state of the subscription

Request URL

$base_url/api/v0/subscriptions/2011!location!D2D0C6A8E334B242289FBAA7F69759C3/2011!module!49CBD432F01E8C5057B344E02604A773?state=false

Response Code: 204 (No content)

  • No labels