Backend API
Type
GET
Uri
api/task
DataType
json
Comments
Fetch and return all tasks
Expected updates
{
series: [
{
name: "Sudenpennut",
color: "#f5ea2e",
id: "5e4ec2033661d81858295d91"
}
],
files: [ ],
ratings: [
0,
0,
0,
0,
0
],
name: "sfsfs",
assignmentText: "<p>sfsfsf</p> ",
assignmentTextMD: "sfsfsf",
supervisorInstructions: "",
supervisorInstructionsMD: "",
gradingScale: "",
gradingScaleMD: "",
creatorName: "fsf",
creatorEmail: "sfsf",
pending: false,
category: {
name: "Retkeilytaidot",
id: "5e73f8830b30432ec0e500be"
},
language: {
name: "Suomi",
id: "5e4ec1f73661d81858295d8f"
},
rules: {
name: "Nykyiset",
id: "5e4ec1ed3661d81858295d8d"
},
views: 1,
ratingsAVG: 0,
ratingsAmount: 0,
created: "2020-05-05T23:40:35.161Z",
id: "5eb1f97328585747d4a05270"
}
Type
GET
Uri
api/task/pending
DataType
json
Comments
Fetch and return task that are waiting for admin acceptance
Expected updates
{
series: [
{
name: "Sudenpennut",
color: "#f5ea2e",
id: "5e4ec2033661d81858295d91"
}
],
files: [ ],
ratings: [
0,
0,
0,
0,
0
],
name: "sfsfs",
assignmentText: "<p>sfsfsf</p> ",
assignmentTextMD: "sfsfsf",
supervisorInstructions: "",
supervisorInstructionsMD: "",
gradingScale: "",
gradingScaleMD: "",
creatorName: "fsf",
creatorEmail: "sfsf",
pending: false,
category: {
name: "Retkeilytaidot",
id: "5e73f8830b30432ec0e500be"
},
language: {
name: "Suomi",
id: "5e4ec1f73661d81858295d8f"
},
rules: {
name: "Nykyiset",
id: "5e4ec1ed3661d81858295d8d"
},
views: 1,
ratingsAVG: 0,
ratingsAmount: 0,
created: "2020-05-05T23:40:35.161Z",
id: "5eb1f97328585747d4a05270"
}
Type
DELETE
Uri
api/task/:id
DataType
json
Comments
requires valid token
Expected updates
Type
GET
Uri
api/task/:id
DataType
json
Comments
return task with specified id
Expected updates
{
series: [
{
name: "Sudenpennut",
color: "#f5ea2e",
id: "5e4ec2033661d81858295d91"
}
],
files: [ ],
ratings: [
0,
0,
0,
0,
0
],
name: "sfsfs",
assignmentText: "<p>sfsfsf</p> ",
assignmentTextMD: "sfsfsf",
supervisorInstructions: "",
supervisorInstructionsMD: "",
gradingScale: "",
gradingScaleMD: "",
creatorName: "fsf",
creatorEmail: "sfsf",
pending: false,
category: {
name: "Retkeilytaidot",
id: "5e73f8830b30432ec0e500be"
},
language: {
name: "Suomi",
id: "5e4ec1f73661d81858295d8f"
},
rules: {
name: "Nykyiset",
id: "5e4ec1ed3661d81858295d8d"
},
views: 1,
ratingsAVG: 0,
ratingsAmount: 0,
created: "2020-05-05T23:40:35.161Z",
id: "5eb1f97328585747d4a05270"
}
Type
PUT
Uri
api/task
DataType
json
Comments
Expected updates
Type
POST
Uri
api/task
DataType
json
Comments
Expected updates
{
series: [
{
name: "Sudenpennut",
color: "#f5ea2e",
id: "5e4ec2033661d81858295d91"
}
],
files: [ ],
ratings: [
0,
0,
0,
0,
0
],
name: "sfsfs",
assignmentText: "<p>sfsfsf</p> ",
assignmentTextMD: "sfsfsf",
supervisorInstructions: "",
supervisorInstructionsMD: "",
gradingScale: "",
gradingScaleMD: "",
creatorName: "fsf",
creatorEmail: "sfsf",
pending: false,
category: {
name: "Retkeilytaidot",
id: "5e73f8830b30432ec0e500be"
},
language: {
name: "Suomi",
id: "5e4ec1f73661d81858295d8f"
},
rules: {
name: "Nykyiset",
id: "5e4ec1ed3661d81858295d8d"
},
views: 1,
ratingsAVG: 0,
ratingsAmount: 0,
created: "2020-05-05T23:40:35.161Z",
id: "5eb1f97328585747d4a05270"
}
Type
PUT
Uri
api/task/:id/accept
DataType
json
Comments
requires valid token
Expected updates
Change tasks pending state
Search and return non pending tasks with specified search term
Type
POST
Uri
api/task/search
DataType
json
Comments
Expected updates
Create and send PDF made from single task
Type
POST
Uri
api/task/:id/pdf
DataType
json
Comments
Expected updates
Create multiple PDFs and return them as zip file
Type
POST
Uri
api/task/pdf
DataType
json
Comments
Expected updates
Add rating to specified task
Type
POST
Uri
api/task/:id/rate
DataType
json
Comments
pdate tasks rating list, amount and average and returns updated rating data
Expected updates
Type
GET
Uri
api/rule
DataType
json
Comments
Fetch all rules, populate pointers
Expected updates
{
task: [ ],
acceptedCategories: [
{
task: [ ],
name: "Kädentaidot",
id: "5ea9eb670b3fef10aceb9e45"
}
],
name: "Menneet",
__v: 0,
id: "5ea9eb830b3fef10aceb9e46"
}
Type
POST
Uri
api/rule
DataType
json
Comments
requires valid token
Expected updates
{
task: [ ],
acceptedCategories: [
{
task: [ ],
name: "Kädentaidot",
id: "5ea9eb670b3fef10aceb9e45"
}
],
name: "Menneet",
__v: 0,
id: "5ea9eb830b3fef10aceb9e46"
}
Type
DELETE
Uri
api/rule/:id
DataType
json
Comments
requires valid token
Expected updates
Type
PUT
Uri
api/rule/:id
DataType
json
Comments
requires valid token
Expected updates
{
task: [ ],
acceptedCategories: [
{
task: [ ],
name: "Kädentaidot",
id: "5ea9eb670b3fef10aceb9e45"
}
],
name: "Menneet",
__v: 0,
id: "5ea9eb830b3fef10aceb9e46"
}
Type
POST
Uri
api/login
DataType
json
Comments
Expected updates
Type
Get
Uri
api/language
DataType
json
Comments
Expected updates
{
task: [ ],
name: "Ruotsi2",
__v: 0,
id: "5ea9eb300b3fef10aceb9e44"
}
Type
POST
Uri
api/language
DataType
json
Comments
requires valid token
Expected updates
{
task: [ ],
name: "Ruotsi2",
__v: 0,
id: "5ea9eb300b3fef10aceb9e44"
}
Type
DELETE
Uri
api/language/:id
DataType
json
Comments
requires valid token
Expected updates
Type
PUT
Uri
api/language/:id
DataType
json
Comments
Expected updates
{
task: [ ],
name: "Ruotsi2",
__v: 0,
id: "5ea9eb300b3fef10aceb9e44"
}
Type
Get
Uri
api/categories
DataType
json
Comments
Fetch all categories, populate pointers
Expected updates
{
task: [ ],
name: "Kätevyys",
id: "5e73f81a0b30432ec0e500bb"
},
Type
POST
Uri
api/categories
DataType
json
Comments
requires valid token
Expected updates
{
task: [ ],
name: "Kätevyys",
id: "5e73f81a0b30432ec0e500bb"
},
Type
DELETE
Uri
api/categories/:id
DataType
json
Comments
requires valid token
Expected updates
Type
GET
Uri
api/series
DataType
json
Comments
Expected updates
Type
GET
Uri
api/series
DataType
json
Comments
requires valid token
Expected updates
Type
DELETE
Uri
api/series
DataType
json
Comments
requires valid token
Expected updates
Type
PUT
Uri
api/series/:id
DataType
json
Comments
Update name and color of series
Expected updates
Comments
Get all comments
Type
GET
Uri
api/comment
DataType
json
Comments
Expected updates
{
content: "testi",
nickname: "testi",
created: "2020-04-09T14:56:20.974Z",
pending: false,
task: "5e7ba15e8e2e1249e8f8772d",
id: "5e8f379432a1452e383e50d3"
},
Get all comments waiting for acceptance
Type
GET
Uri
api/comments/pending
DataType
json
Comments
requires valid token
Expected updates
{
content: "testi",
nickname: "testi",
created: "2020-04-09T14:56:20.974Z",
pending: false,
task: "5e7ba15e8e2e1249e8f8772d",
id: "5e8f379432a1452e383e50d3"
},
Get single non pending comment
Type
GET
Uri
api/comment/:id
DataType
json
Comments
Expected updates
{
content: "testi",
nickname: "testi",
created: "2020-04-09T14:56:20.974Z",
pending: true,
task: "5e7ba15e8e2e1249e8f8772d",
id: "5e8f379432a1452e383e50d3"
},
Add comment
Type
POST
Uri
api/comment
DataType
json
Comments
additions with valid token in request are auto accepted
Expected updates
{
content: "testi",
nickname: "testi",
created: "2020-04-09T14:56:20.974Z",
pending: false,
task: "5e7ba15e8e2e1249e8f8772d",
id: "5e8f379432a1452e383e50d3"
},
Delete comment
Type
DELETE
Uri
api/comment
DataType
json
Comments
requires valid token
Expected updates
Accepet comment
Type
PUT
Uri
api/comment/:id/accept
DataType
json
Comments
requires valid token
Expected updates
Delete blobs if list is given, Add files to blob storage
Type
POST
Uri
api/file
DataType
json
Comments
Expected updates
Type
GET
Uri
api/user
DataType
json
Comments
Expected updates
{
username: "kesti",
name: "pesti",
email: "[email protected] ",
allowNotifications: false,
__v: 0
},
Type
POST
Uri
api/user
DataType
json
Comments
Expected updates
{
username: "kesti",
name: "pesti",
email: "[email protected] ",
allowNotifications: false,
__v: 0
},
Path used to create the first admin user
Type
POST
Uri
api/user/adminkey
DataType
json
Comments
Expected updates
{
username: "kesti",
name: "pesti",
email: "[email protected] ",
allowNotifications: false,
__v: 0
},
Type
PUT
Uri
api/user
DataType
json
Comments
Expected updates
{
username: "kesti",
name: "pesti",
email: "[email protected] ",
allowNotifications: false,
__v: 0
},