/login [POST]
{
username: (mail)
password: (password)
}
{
tocken: "token valid for 30 days",
expiration: "UNIX timestamp in seconds",
firstname: "The first name",
surname: "The family name",
uid: "the user id in the database used to make requests",
type: "1 SEKI, 2 SekII, 3 teacher, 4 admin",
}
The token will be saved as a cookie (called token) and will be send with every further request
/user/<userid> [GET]
/profile
None
{
firsname: "The first name",
surname: "The family name",
uid: "the user id in the database used to make requests",
type: "1 SEKI, 2 SekII, 3 teacher, 4 admin",
}
This request returns general userinfo used by the webiterface
/teacher/<teacherid>/courses [GET]
None
{
courses: [{
subject: "the kind of the course (math, physics etc.)",
cid: "the id",
generation: "SEKI/SEKII"
}{
...
}]
}
This will be fetched when the teacher is logging in and the client shows all courses the teacher teaches. classes he teaches like ma-4 etc.
/courses/<courseid>/students [GET]
None
{
subject: "...",
cid: "...",
generation: "",
students: [{
firsname: "The first name",
surname: "The family name",
uid: "the id of the student"
},{
...
}]
}
This is used to render the colums of the table with the grades
/courses/<courseid>/markmetas [POST,PUT,DELETE]
name, valance
{
"success":true
}
{
error: 401/404,
msg: "Humanreadable Message",
}
Using authetification headers (like oauth)
Authorization
get set to Bearer <token>
Example:
Accept: application/json
Authorization: Bearer K3nnpiMFi8nEHnk0VK1RNR94a2PmOYC0
Origin: http://localhost:8080
Referer: http://localhost:8080/
...