Register a new account
-
URL
/register
-
Method:
POST
-
URL Params
-
Data Params
Required:
Body:{email: [email], password: [password]}
Optional:
Body:{alias: [alias]}
-
Success Response:
- Code: 200
Content:{message: "User Registered", email:[email]}
- Code: 200
-
Error Response:
- Code: 400 BAD REQUEST
Content:{message: "email is already taken"}
OR
- Code: 400 BAD REQUEST
Content:{message: "Please use proper email format"}
OR
- Code: 400 BAD REQUEST
Content:{ message: "Password must be between 4 to 32 characters" }
OR
- Code: 400 BAD REQUEST
Content:{ message: "Please Fill Email and Password" }
OR
- Code: 500 SERVER ERROR
- Code: 400 BAD REQUEST
Log in to existing account
-
URL
/login
-
Method:
POST
-
URL Params
-
Data Params
Required:
Body:{email: [email], password: [password]}
-
Success Response:
- Code: 200
Content:{message: "login successful", access_token: [token]}
- Code: 200
-
Error Response:
- Code: 404 NOT FOUND
Content:{message: "Email not found"}
OR
- Code: 401 UNAUTHORIZED
Content:{ message: "Wrong Password" }
OR
- Code: 400 BAD REQUEST
Content:{ message: "Please Fill Email and Password" }
OR
- Code: 500 SERVER ERROR
- Code: 404 NOT FOUND
Get all tasks
-
URL
/task
-
Method:
GET
-
URL Params
-
Data Params
Required:
Headers:{access_token: [token]}
-
Success Response:
- Code: 200
Content:[ { "id": [id], "name": [name], "deadline": [deadline], "category": [category], "UserId": [uid], "updatedAt": [Update Date], "createdAt": [Create Date], "user": {[alias: alias]} }, { "id": [id], "name": [name], "deadline": [deadline], "category": [category], "UserId": [uid], "updatedAt": [Update Date], "createdAt": [Create Date], "user": {[alias: alias]}, "editable: true } ]
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ message: "Login Error" }
OR
- Code: 500 SERVER ERROR
- Code: 401 UNAUTHORIZED
Post a new Task
-
URL
/task
-
Method:
POST
-
URL Params
-
Data Params
Required:
Body:{name: [name], category: [category]}
Headers:{access_token: [token]}
Optional:
Body:{deadline: [deadline]}
-
Success Response:
-
Code: 200
Content:{ "id": [id], "name": [name], "deadline": [deadline], "category": [category], "UserId": [uid], "updatedAt": [Update Date], "createdAt": [Create Date] }
-
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ message: "Login Error" }
OR
- Code: 400 BAD REQUEST
Content:{ message: "Task name may not be empty" }
OR
- Code: 400 BAD REQUEST
Content:{ message: "Deadline must be after today" }
OR
- Code: 400 BAD REQUEST
Content:{ message: "Invalid Category" }
OR
- Code: 500 SERVER ERROR
- Code: 401 UNAUTHORIZED
edit existing task
-
URL
/task
-
Method:
PUT
-
URL Params Required: id
-
Data Params
Required:
Headers:{access_token: [token]}
Optional:
Body:{name: [name], category: [category], deadline: [deadline]}
-
Success Response:
-
Code: 200
Content:{ "id": [id], "name": [name], "deadline": [deadline], "category": [category], "UserId": [uid], "updatedAt": [Update Date], "createdAt": [Create Date] }
-
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ message: "Login Error" }
OR
- Code: 401 UNAUTHORIZED
Content:{ message: "User does not have permission" }
OR
- Code: 400 BAD REQUEST
Content:{ message: "Invalid Category" }
OR
- Code: 500 SERVER ERROR
- Code: 401 UNAUTHORIZED
Change existing task's category
-
URL
/task
-
Method:
Patch
-
URL Params Required: id
-
Data Params
Required:
Headers:{access_token: [token]}
Optional:
Body:{name: [name], category: [category], deadline: [deadline]}
-
Success Response:
-
Code: 200
Content:{ "id": [id], "name": [name], "deadline": [deadline], "category": [category], "UserId": [uid], "updatedAt": [Update Date], "createdAt": [Create Date] }
-
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ message: "Login Error" }
OR
- Code: 401 UNAUTHORIZED
Content:{ message: "User does not have permission" }
OR
- Code: 400 BAD REQUEST
Content:{ message: "Invalid Category" }
OR
- Code: 500 SERVER ERROR
- Code: 401 UNAUTHORIZED