KANBAN API
Create a new user.
Request Body:
-
Schema
Value:
- name: string,
- email: string,
- password: string,
Example
{ "name": "Ajeng", "email": "ajeng@gmail.com" "password": "ajenghacktiv8" }
Response:
-
201
Example:
{ "id": 6, "name": "Ajeng", "email": "ajeng@gmail.com" "password": "$2a$10$.nhegcxKFs56KKw1XTOf..fptzznZT4.ZshIwlNz5Uuvg7tGRcrCu", "updatedAt": "2020-02-14T17:46:58.266Z", "createdAt": "2020-02-14T17:46:58.266Z" }
-
400
Example:
{ "email": "E-mail should not be empty!" }
-
500
User login.
Request Body:
-
Schema
Value:
- email: string,
- password: string,
Example
{ "email": "ajeng@gmail.com" "password": "ajenghacktiv8" }
Response:
-
201
Example:
{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJ0ZXNAZ21haWwuY29tIiwiaWF0IjoxNTgxNzAyMjI2fQ.D44jSOpp5j1yAE_KklMKUYqTc-pwALusakfwWpIdz3M", "UserId": 1 }
-
400
Example:
"Invalid email / password!"
-
404
Example:
"User not found!"
-
500
User login with google.
Request Body:
-
Schema
Value:
- email: string,
- password: string,
Example
{ "email": "ajeng@gmail.com" "password": "ajenghacktiv8" }
Response:
-
201
Example:
{ token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6I…cwMX0.FrhEDezYKS6WlHtR7VRj9RtCXLF-CA1diMgLCqsGeG0", UserId: 4 }
-
500
Create a new kanban.
Request Body:
-
Schema
Value:
- title: string,
- description: string,
Example
{ "title": "Create Kanban App", "description": "Learn how to create RESTful API" }
Response:
-
201
Example:
{ "id": 13, "title": "tes", "description": "tes", "status": "backlog", "UserId": 1, "updatedAt": "2020-02-14T17:54:38.632Z", "createdAt": "2020-02-14T17:54:38.632Z" }
-
400
Example:
{ "message": "Validation error: Title must be filled!" }
-
500
Show all kanban list.
Response:
-
200
Example:
{ "id": 1, "title": "Create kanban", "description": "Learn how to create RESTful API", "status": "backlog" "due_date": "2020-02-08" }, { "id": 2, "title": "Create kanban", "description": "Learn how to create RESTful API", "status": "backlog" "due_date": "2020-02-08" }
-
500
Show kanban list by id.
Request Params:
id: integer
example: http://localhost:3000/kanban/2
Response:
-
200
Example:
{ "id": 2, "title": "Create kanban", "description": "Learn how to create RESTful API", "status": "backlog", "due_date": "2020-02-08" }
-
404
Example:
{ "message": "Error 404, command not found!" }
Update kanban list by id.
Request params:
id: integer
example: http://localhost:3000/kanban/2
Request Body:
-
Schema
Value:
- title: string,
- description: string,
- status: string,
Example
{ "title": "Create kanban", "description": "Learn how to create RESTful API", "status": "todo" "due_date": "2020-02-08" }
Response:
-
200
Example:
{ "id": 2, "title": "Create kanban", "description": "Learn how to create RESTful API", "status": "todo", "due_date": "2020-02-08" }
-
404
Example:
{ "message": "Validation error: Title must be filled!" }
-
400
Example:
{ "message": "Error 404, command not found!" }
-
500
Delete kanban list by id.
Request params:
id: integer
example: http://localhost:3000/kanban/3
Response:
-
200
Example:
{ "id": 2, "title": "Create kanban", "description": "Learn how to create RESTful API", "status": "done", "due_date": "2020-02-08" }
-
404
Example:
{ "message": "Error 404, command not found!" }
-
500