For a more precise request of a certain status, check link below Link to postman documentations: https://documenter.getpostman.com/view/10571131/SzKbKuJS
Get all todos that the user have
- token (String)
{
"token" : "<your_token>"
}
Status 200
[
{
"id": 75,
"title": "wewafd",
"description": "wew",
"status": "Not Started",
"due_date": "2020-03-08",
"createdAt": "2020-03-07T04:05:58.726Z",
"updatedAt": "2020-03-07T04:19:02.101Z",
"UserId": 6
},
{
"id": 76,
"title": "Berhasil diedit",
"description": "Membuat route sesuai REST dan membuat dokumentasi",
"status": "Not Started",
"due_date": "2020-03-04",
"createdAt": "2020-03-07T04:10:58.064Z",
"updatedAt": "2020-03-07T04:44:03.927Z",
"UserId": 6
},
{
"id": 77,
"title": "Belajar gituan",
"description": "gituan apa si",
"status": "Not Started",
"due_date": "2020-03-08",
"createdAt": "2020-03-07T04:36:08.958Z",
"updatedAt": "2020-03-07T04:36:08.958Z",
"UserId": 6
}
]
Create a todo
- Title (String)
- Can not be null or empty
- Description (String)
- Can not be null or empty
- Due Date (String)
- Can not be null or empty
- YYYY/MM/DD format
- Status (String)
User do not input a status as the status was set on default to 'Not Started'
{
"Content-Type": "application/json",
"token" : "<your_token>"
}
Status 201
{
"msg": "New Todo has been created",
"newTodo": {
"title": "Belajar gituan",
"description": "gituan apa si",
"due_date": "2020-03-08",
"UserId": 6
}
}
Status 400
{
"status": 400,
"msg": [
"Validation errors (title can not be empty)"
]
}
Update a todo by the id from the todos resources
- id (Number)
- Gotten from the client
- Title (String)
- Can not be null or empty
- Description (String)
- Can not be null or empty
- Due Date (String)
- Can not be null or empty
- YYYY/MM/DD format
- Status (String)
{
"Content-Type": "application/json",
"token" : "<your_token>"
}
{
"title" : "Berhasil diedit",
"description" : "Membuat route sesuai REST dan membuat dokumentasi",
"due_date" : "2020-03-04"
}
Status (200)
{
"msg": "Todo has been edited",
"editedTodo": {
"title": "Berhasil diedit",
"description": "Membuat route sesuai REST dan membuat dokumentasi",
"due_date": "2020-03-04"
}
}
Status (400)
{
"status": 400,
"msg": [
"Validation errors (title can not be empty)",
"Validation errors (description can not be empty)",
"Validation errors (due_date can not be empty)"
]
}
Status (403)
{
"status": 403,
"msg": "You are not authorized"
}
Status (404)
{
"status": 404,
"msg": "Todo not found"
}
Delete a todo
- id (Number)
- Gotten from the client
{
"Content-Type": "application/json",
"token" : "<your_token>"
}
Status (200)
{
"id": 75,
"title": "wewafd",
"description": "wew",
"status": "Not Started",
"due_date": "2020-03-08",
"createdAt": "2020-03-07T04:05:58.726Z",
"updatedAt": "2020-03-07T04:19:02.101Z",
"UserId": 6
}
Status (403)
{
"status": 403,
"msg": "You are not authorized"
}
Status (404)
{
"status": 404,
"msg": "Todo not found"
}
Sign up an account
- first_name (String)
- Can not be null or empty
- last_name (String)
- Can not be null or empty
- email (String)
- Can not be null or empty
- password (String)
- Can not be null or empty
{
"Content-Type": "application/json"
}
{
"first_name" : "Puji",
"last_name" : "Yanto",
"email" : "[email protected]",
"password" : "qeqeqe"
}
Status (201)
{
"id": 16,
"first_name": "Puji",
"last_name": "Yanto",
"email": "[email protected]",
"password": "qeqeqe",
"updatedAt": "2020-03-07T05:14:26.233Z",
"createdAt": "2020-03-07T05:14:26.233Z"
}
Status (400)
{
"status": 400,
"msg": [
"Validation errors (First Name can not be empty)",
"Validation errors (Last name can not be empty)",
"Validation errors (Email can not be empty)",
"Validation errors (Password can not be empty)"
]
}
Login to an account Generates a token for authentication
- email (String)
- password (String)
{
"Content-Type": "application/json"
}
{
"email" : "[email protected]",
"password" : "qwerty"
}
Status (200)
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NiwiZW1haWwiOiJha2JhckBnbWFpbC5jb20iLCJpYXQiOjE1ODM1NTM1OTN9.pV44TwKKmaEKIwXgs5-JTLosad7HSji8gIvtWN4Acvs"
Status (400)
{
"status": 400,
"msg": "Wrong Email / Password"
}
Login to an account with a google acount
- Google Token (String)
- Gotten from google sign-in server
{
"Content-Type": "application/json"
}
{
"token" : "<token_from_google>"
}
Status (200)
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwiZW1haWwiOiJoZW5hcml2YW5hYUBnbWFpbC5jb20iLCJpYXQiOjE1ODM1NTk5MjF9.q0qRNCzGxjC1TeqsaHxwqINnLu2FXRjTD3IulTJlzE8"