{"swagger":"2.0","info":{"description":"AAD 2020-2021 API definition","version":"1.0.0","title":"AAD 2020-2021 API","license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"tags":[{"name":"user","description":"Operations about user"},{"name":"tasks","description":"Operations about tasks"}],"paths":{"/register":{"post":{"tags":["user"],"operationId":"registerUser","description":"registers a new user","produces":["application/json"],"parameters":[{"in":"query","name":"username","description":"The desired username","type":"string"},{"in":"query","name":"password","description":"The desired password","type":"string"},{"in":"query","name":"Email","description":"The desired E-mail for the user","type":"string"}],"responses":{"200":{"description":"The user was created successfully"},"400":{"description":"There was an error during creation of the user"}}}},"/login":{"post":{"tags":["user"],"operationId":"logIn","description":"Log in with username and password","produces":["application/json"],"parameters":[{"in":"query","name":"username","description":"The username of the account","type":"string"},{"in":"query","name":"password","description":"The password of the account","type":"string"}],"responses":{"200":{"description":"The login token for the user","schema":{"type":"string"}},"400":{"description":"There was an error during login of the user"}}}},"/tasks":{"get":{"tags":["tasks"],"operationId":"getTasks","description":"Get personal tasks for logged in user","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"}],"responses":{"200":{"description":"A list of tasks of the user","schema":{"type":"array","items":{"$ref":"#/definitions/task"}}},"400":{"description":"There was an error during retrieval of tasks"}}}},"/tasks/{taskId}":{"get":{"tags":["tasks"],"operationId":"getTask","description":"Get specific task","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"path","name":"taskId","required":true,"description":"The id of the task","type":"string"}],"responses":{"200":{"description":"The specifiec task","schema":{"$ref":"#/definitions/task"}},"400":{"description":"There was an error during fetch of the task"},"403":{"description":"Access to specified task is forbidden"},"404":{"description":"Task not found"}}},"put":{"tags":["tasks"],"operationId":"updateTask","description":"Update specific task","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"path","name":"taskId","required":true,"description":"The id of the task","type":"string"},{"in":"body","name":"updatedTask","description":"Updated task","required":true,"schema":{"$ref":"#/definitions/task"}}],"responses":{"200":{"description":"The task was updated successfully"},"400":{"description":"There was an error during update of the task"},"403":{"description":"Access to specified task is forbidden"},"404":{"description":"Task not found"}}},"delete":{"tags":["tasks"],"operationId":"deleteTask","description":"Delete specific task","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"path","name":"taskId","required":true,"description":"The id of the task","type":"string"}],"responses":{"200":{"description":"The task was deleted successfully"},"400":{"description":"There was an error during deletion of the task"},"403":{"description":"Access to specified task is forbidden"},"404":{"description":"Task not found"}}}},"/groups":{"get":{"tags":["groups"],"operationId":"getGroups","description":"Get a list of groups a user belongs to","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"}],"responses":{"200":{"description":"A list of groups of the user","schema":{"type":"array","items":{"$ref":"#/definitions/group"}}},"400":{"description":"There was an error during fetch of groups"}}}},"/groups/{groupId}":{"get":{"tags":["groups"],"operationId":"getGroup","description":"Get specific group","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"path","name":"groupId","required":true,"description":"The id of the group","type":"string"}],"responses":{"200":{"description":"The specified group","schema":{"$ref":"#/definitions/group"}},"400":{"description":"There was an error during fetch of the group"},"403":{"description":"Access to specified group is forbidden"},"404":{"description":"group not found"}}},"put":{"tags":["groups"],"operationId":"updateGroup","description":"Update specific group","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"body","name":"updatedGroup","description":"Updated group","required":true,"schema":{"$ref":"#/definitions/group"}},{"in":"path","name":"groupId","required":true,"description":"The id of the group","type":"string"}],"responses":{"200":{"description":"The group was updated successfully"},"400":{"description":"There was an error during update of the group"},"403":{"description":"Access to specified group is forbidden"},"404":{"description":"Group not found"}}},"delete":{"tags":["groups"],"operationId":"deleteGroup","description":"Delete specific group","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"path","name":"groupId","required":true,"description":"The id of the group","type":"string"}],"responses":{"200":{"description":"The group was deleted successfully"},"400":{"description":"There was an error during deletion of the group"},"403":{"description":"Access to specified group is forbidden"},"404":{"description":"Group not found"}}}},"/groups/{groupId}/tasks/{taskId}":{"get":{"tags":["groups"],"operationId":"getTaskOfGroup","description":"Get specific task of group","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"path","name":"taskId","required":true,"description":"The id of the task","type":"string"},{"in":"path","name":"groupId","required":true,"description":"The id of the group","type":"string"}],"responses":{"200":{"description":"The specified task of the group","schema":{"$ref":"#/definitions/task"}},"400":{"description":"There was an error during fetch of the task"},"403":{"description":"Access to specified task is forbidden"},"404":{"description":"Task not found"}}},"put":{"tags":["groups"],"operationId":"updateTaskOfGroup","description":"Update specific task","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"path","name":"taskId","required":true,"description":"The id of the task","type":"string"},{"in":"path","name":"groupId","required":true,"description":"The id of the group","type":"string"},{"in":"body","name":"updatedTask","description":"Updated task","required":true,"schema":{"$ref":"#/definitions/task"}}],"responses":{"200":{"description":"The task was updated successfully"},"400":{"description":"There was an error during update of the task"},"403":{"description":"Access to specified task is forbidden"},"404":{"description":"Task not found"}}},"delete":{"tags":["groups"],"operationId":"deleteTaskOfGroup","description":"Delete specific task of group","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"path","name":"taskId","required":true,"description":"The id of the task","type":"string"},{"in":"path","name":"groupId","required":true,"description":"The id of the group","type":"string"}],"responses":{"200":{"description":"The task was deleted successfully"},"400":{"description":"There was an error during deletion of the task"},"403":{"description":"Access to specified task is forbidden"},"404":{"description":"Task not found"}}}},"/roles":{"get":{"tags":["roles"],"operationId":"getRoles","description":"Get all roles","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"}],"responses":{"200":{"description":"A list of roles","schema":{"type":"array","items":{"$ref":"#/definitions/role"}}},"400":{"description":"There was an error during retrieval of roles"}}}},"/invite":{"post":{"tags":["roles"],"operationId":"createInvite","description":"Creates an invite for a group for the specified user with the specified role","produces":["application/json"],"parameters":[{"in":"header","name":"token","description":"The login token of the user","type":"string"},{"in":"header","name":"userId","description":"The id of the user that is invited","type":"string"},{"in":"header","name":"groupId","description":"The id of the group the user is invited to","type":"string"},{"in":"header","name":"roleId","description":"The id of the role the user is invited to","type":"string"}],"responses":{"200":{"description":"The invitation was successfully created"},"400":{"description":"There was an error during creation of invitation"}}}}},"definitions":{"user":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"password":{"type":"string"},"personalTasks":{"type":"array","items":{"$ref":"#/definitions/task"}}}},"task":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"subTasks":{"type":"array","items":{"$ref":"#/definitions/subTask"}},"completed":{"type":"boolean"}}},"subTask":{"type":"object","properties":{"id":{"type":"integer"},"taskId":{"type":"integer"},"name":{"type":"string"},"completed":{"type":"boolean"}}},"role":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"group":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"tasks":{"type":"array","items":{"$ref":"#/definitions/task"}},"users":{"type":"array","items":{"$ref":"#/definitions/userRoleRelation"}}}},"userRoleRelation":{"type":"object","properties":{"userId":{"type":"integer"},"userName":{"type":"string"},"roleId":{"type":"integer"}}}},"host":"virtserver.swaggerhub.com","basePath":"/AAD_2020_2021/AAD_backend/1.0.0","schemes":["https"]}