Reservations

Calendar reservations (reservation) API lists reservartions of specific rooms and implementations. Reservation contains basic information like date and list of “resources”, which can be rooms and implementations.

Related to reservation API, there is buildings and rooms (building) method described in the bottom of this page, which lists campus building and class room information.

API address: https://opendata.tamk.fi/r1/reservation
See API documentation in Swagger UI

Reservation

Field Type Description
id number Unique database identifier of the reservation
modifiedDate date Last modification date
subject text Subject of the reservation
description text Possible details of the reservation
startDate date Start date and time of the reservation
endDate date End date and time of the reservation
resources list Resources connected to the reservation

Resource of reservation

Field Type Description
id number Unique database identifier of the resource
type text Resource type:realization: course unit implementation

student_group: student group

scheduling_group: study group

room: room in a building

building: building where the room is

code text Official code of the resource
name text Name of the resource

Search reservations

Available search fields.

Field Type Description
subject text Free text search for the subject
startDate date Start date and time of the reservation must be the same or greater than the value specified
endDate date End date and time of the reservation must be the same or less than the value specified
rangeStart date Start date and time of the reservation is at the specified value or after it. Reservation is between rangeStart and rangeEnd. Both parameters must be specified, if either is used.
rangeEnd date End date and time of the reservation are before the specified value
realization list Reservation is for the specific course unit implementation (code of the implementation)
studentGroup list Reservation is for the specific student group (code of the group).
room list Reservation is for the specific room (code of the room)
building list Reservation is for the room that is in the specified building (code of the building)
from number Return search results beginning from the given number. Default is 0.
size number Maximum number of search results. Default is 1000.

Search is “AND” between different fields. Parameters of ‘list’ type are “OR” between the elements inside the same list.

Get information about single reservation

Simple GET request can be used, if the ID of the reservation is known:

curl -u "<API key>:" https://opendata.tamk.fi/r1/reservation/180733

Wider reservation search

Notice that reservations for course unit implemantions could have been made either for the implementation or the group, or both.

Usually both, group and implementation, are recorded in the reservation information. If you want to find all reservations for certain group, you can search just by specifying the group.

You can if certain period is free, or what reservations are for that period, using time frame search (rangeStartrangeEnd).

Example: find reservations for certain course unit implementations:

curl -u "<API key>:" -X POST https://opendata.tamk.fi/r1/reservation/search -d '{
   "realization":["4-AOT5-3002", "4-ATV10-3002"]
}'

Example: reservations for certain student group. Notice that it is not possible to search for different implementations and groups with the same request, because the search term is “AND” between different fields.

curl -u "<API key>:" -X POST https://opendata.tamk.fi/r1/reservation/search -d '{
   "studentGroup":["13TIKOOT"]
}'

Example: find all reservation, which are effective on the 22nd of October between 9 o’clock and 10 o’clock in the given building. The reservation could have been started before 9, and it can continue after 10.

curl -u "<API key>:" -X POST https://opendata.tamk.fi/r1/reservation/search -d '{
   "rangeStart": "2014-10-22T09:00",
   "rangeEnd": "2014-10-22T10:00",
   "building": ["C-talo"]
}'

Example: find what studies are during the given time frame. You can search for reservations that begin after certain date and time. Gather individual implementations and class rooms from the response. You can also add search term for building, if you want only studies in specific campus or building.

curl -u "<API key>:" -X POST https://opendata.tamk.fi/r1/reservation/search -d '{
   "startDate": "2014-10-27T09:00",
   "endDate": "2014-10-27T15:00",
   "building": ["A-talo"]
}'

Example: reservations for the specific room during the specified time period:

curl -u "<API key>:" -X POST https://opendata.tamk.fi/r1/reservation/search -d '{
   "startDate":"2014-10-27T08:00",
   "endDate":"2014-10-27T18:00",
   "room":["C4-12"]
}'

Response

Field Description
status Indicates if the request was succesful; “success”, “warn”, “error”
message Possible message detailing the error message, for example
reservations List of reservations

Response to the previous request:

{
  "reservations": [
    {
      "description": "",
      "resources": [
        {
          "name": "Atk-luokka, Tradenomikoulutus",
          "parent": {
            "name": "C-talo  Building C",
            "code": "C-talo",
            "type": "building",
            "id": "8"
          },
          "code": "C4-12",
          "type": "room",
          "id": "61"
        },
        {
          "name": "Open Source -käyttöjärjestelmän palvelut",
          "code": "4-ATV10-3002",
          "type": "realization",
          "id": "30363"
        },
        {
          "name": "13TIKOTV",
          "code": "13TIKOTV",
          "type": "student_group",
          "id": "29174"
        }
      ],
      "endDate": "2014-10-27T12:00",
      "startDate": "2014-10-27T08:00",
      "modifiedDate": "2014-09-24T17:01",
      "subject": "Open Source -käyttöjärjestelmän palvelut 4-ATV10-3002",
      "id": "207223"
    },
    {
      "description": "",
      "resources": [
        {
          "name": "Atk-luokka, Tradenomikoulutus",
          "parent": {
            "name": "C-talo  Building C",
            "code": "C-talo",
            "type": "building",
            "id": "8"
          },
          "code": "C4-12",
          "type": "room",
          "id": "61"
        },
        {
          "name": "Graafisen käyttöliittymän ohjelmointi",
          "code": "4-AOT5-3002",
          "type": "realization",
          "id": "30372"
        },
        {
          "name": "13TIKOOT",
          "code": "13TIKOOT",
          "type": "student_group",
          "id": "29164"
        }
      ],
      "endDate": "2014-10-27T17:00",
      "startDate": "2014-10-27T12:30",
      "modifiedDate": "2014-09-24T17:01",
      "subject": "Graafisen käyttöliittymän ohjelmointi 4-AOT5-3002",
      "id": "207240"
    }
  ],
  "status": "success"
}

Buildings and rooms

To get started, all buildings can be listed with simple request to the API:

curl -u "<API key>:" https://opendata.tamk.fi/r1/reservation/building

Then you can list all rooms in the specific building:

curl -u "<API key>:" https://opendata.tamk.fi/r1/reservation/building/8