endpoint/url : https://dry-castle-71353.herokuapp.com
Get all tasks that the user have
- token (String)
{
"token" : "<your_token>"
}
Status 200
[
{
"id": 35,
"title": "Belajar Vue",
"category": "Backlog",
"difficulty": "Easy",
"createdAt": "2020-03-13T16:21:31.157Z",
"updatedAt": "2020-03-13T16:21:31.157Z",
"UserId": 7
},
{
"id": 36,
"title": "Belajar Socket.io",
"category": "Backlog",
"difficulty": "Easy",
"createdAt": "2020-03-13T16:21:38.683Z",
"updatedAt": "2020-03-13T16:21:38.683Z",
"UserId": 7
}
]
Create a tasks
- Title (String)
- Can not be null or empty
- Category (String)
- Can not be null or empty
- Difficulty (String)
- Can not be null or empty
{
"Content-Type": "application/json",
"token" : "<your_token>"
}
{
"title": "Belajar Vue",
"category": "Backlog",
"difficulty": "Easy"
}
Status 201
{
"id": 34,
"title": "Belajar Vue",
"category": "Backlog",
"difficulty": "Easy",
"UserId": 7,
"updatedAt": "2020-03-13T16:12:07.139Z",
"createdAt": "2020-03-13T16:12:07.139Z"
}
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
- Category (String)
- Can not be null or empty
- Difficulty (String)
- Can not be null or empty
{
"Content-Type": "application/json",
"token" : "<your_token>"
}
{
"title": "Belajar Vue",
"category": "Backlog"
}
Status (200)
{
"title": "Belajar Vue",
"category": "Backlog"
}
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 tasks
- id (Number)
- Gotten from the client
{
"Content-Type": "application/json",
"token" : "<your_token>"
}
Status (200)
{
"id": 34,
"title": "Belajar Vue",
"category": "Backlog",
"difficulty": "Easy",
"createdAt": "2020-03-13T16:12:07.139Z",
"updatedAt": "2020-03-13T16:17:11.341Z",
"UserId": 7
}
Status (403)
{
"status": 403,
"msg": "You are not authorized"
}
Status (404)
{
"status": 404,
"msg": "Todo not found"
}
Sign up an account
- 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"
}
{
"name": "wow",
"email": "[email protected]",
"password": "123"
}
Status (201)
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NywiZW1haWwiOiJ3b3dAZ21haWwuY29tIiwiaWF0IjoxNTg0MTE0OTY4fQ.p8V1NH9dN8m4I_x3yIbTO0SRSRZ8ftodsc2QGiHdq3U"
Status (400)
{
"status": 400,
"msg": [
"Validation errors (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": "123"
}
Status (200)
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NywiZW1haWwiOiJ3b3dAZ21haWwuY29tIiwiaWF0IjoxNTg0MTE1MTgxfQ.-kpgcpK3gcDILZixhH4ZehsfiSziuSbNLwqJZHozyHg"
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"