2016-06-11 14:05:30 +02:00
|
|
|
#%RAML 1.0
|
|
|
|
# TiTaMa backend - The backend for TiTaMa, a time table manager.
|
|
|
|
# Copyright (C) 2016 Marcel Kapfer
|
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
title: TiTaMa API
|
|
|
|
description: API of TiTaMa - a time table manager.
|
|
|
|
version: v1
|
|
|
|
mediaType: application/json
|
|
|
|
types:
|
|
|
|
Courses:
|
|
|
|
type: object
|
|
|
|
description: Array containing courses.
|
|
|
|
properties:
|
|
|
|
courses:
|
|
|
|
type: Course[]
|
|
|
|
uniqueItems: true
|
|
|
|
required: false
|
|
|
|
Course:
|
|
|
|
type: object
|
|
|
|
description: Schema describing a course.
|
|
|
|
properties:
|
|
|
|
title:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
time:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
day:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
id:
|
|
|
|
required: true
|
|
|
|
type: number
|
|
|
|
kind:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
place:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
prof:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
turnin:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
/courses:
|
|
|
|
get:
|
|
|
|
description: Get a list of all existing courses.
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
type: Courses
|
|
|
|
404:
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
example: |
|
|
|
|
{"message": "No courses found"}
|
|
|
|
/course:
|
|
|
|
/{id}:
|
|
|
|
get:
|
|
|
|
description: Get the course with id.
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
type: Course
|
|
|
|
example:
|
|
|
|
value:
|
|
|
|
title: Advanced Common Lisp
|
|
|
|
time: "11:00"
|
|
|
|
day: Monday
|
|
|
|
id: 1
|
|
|
|
kind: Lecture
|
|
|
|
place: "Room 1031"
|
|
|
|
prof: "Dr. Kimble"
|
|
|
|
turnin: "Friday 12:00"
|
|
|
|
404:
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
example: |
|
|
|
|
{"message": "Course not found" }
|
|
|
|
delete:
|
|
|
|
description: Delete a course with the id.
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
response:
|
|
|
|
200:
|
|
|
|
body:
|
|
|
|
application/json:
|
2016-06-19 13:29:56 +02:00
|
|
|
type: Courses
|
2016-06-11 14:05:30 +02:00
|
|
|
500:
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
example: |
|
|
|
|
{"message": "Failed to delete course."}
|
2016-06-19 13:29:56 +02:00
|
|
|
put:
|
2016-06-11 14:05:30 +02:00
|
|
|
description: Update the course with the id.
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
schema: Course
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
body:
|
|
|
|
application/json:
|
2016-06-19 13:29:56 +02:00
|
|
|
type: Course
|
2016-06-11 14:05:30 +02:00
|
|
|
500:
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
example: |
|
|
|
|
{"message": "Failed to create/update course."}
|
|
|
|
post:
|
|
|
|
description: Create a new course.
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
schema: Course
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
body:
|
|
|
|
application/json:
|
2016-06-19 13:29:56 +02:00
|
|
|
type: Course
|
2016-06-11 14:05:30 +02:00
|
|
|
500:
|
|
|
|
body:
|
|
|
|
application/json:
|
|
|
|
example: |
|
|
|
|
{"message": "Failed to create/update course."}
|