My todos App is an application to manage your todos. This app has :
- RESTful endpoint for asset's CRUD operation
- JSON formatted response
- GET /todos
- POST /todos
- GET /todos/:id
- PUT /todos/:id
- DELETE /todos:id
- POST /register
- POST /login
Get all todos
Request Header
{
"access_token": "<your access token>"
}
Request Body
not needed
Response (200)
[
{
"id": 1,
"name": "deutsch lernen",
"description": "vom A1 bis A2",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
},
{
"id": 2,
"name": "etwas kochen",
"description": "mittagsessen"
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
}
]
Response (400 - Bad Request)
{
"message": "error validation"
}
Create new asset
Request Header
{
"access_token": "<your access token>"
}
Request Body
{
"title": "<name to get insert into>",
"description": "<description to get insert into>"
"status": "<status to get insert into>",
"due_date": "<due_date to get insert into>"
}
Response (201 - Created)
{
"id": <given id by system>,
"title": "<posted title>",
"description": "<posted description>",
"status": "<posted status>",
"due_date": "<posted due_date>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
}
Response (400 - Bad Request)
{
"message": "Invalid requests"
}
Get todos by Id Request Header
not needed
Request Body
not needed
Response (200)
{
"id": <todos id>,
"title": "<todos title>",
"description": "<todos description>",
"status": "<todos status>",
"due_date": "<todos due_date>",
"createdAt": "2020-04-27T13:15:33.821Z",
"updatedAt": "2020-04-27T13:39:19.162Z"
}
Response (404 - Error Not Found)
{
"message": "<returned error message>"
}
Update todos by Id Request Header
not needed
Request Body
{
"title": "<title to get update into>",
"description": "<description to get update into>",
"status": "<status to get update into>",
"due_date": "<due_date to get update into>"
}
Response (200)
{
"id": <given id by system>,
"title": "<todos updated title>",
"description": "<todos updated description>",
"status": "<todos updated status>",
"due_date": "<todos updated due_date>",
"createdAt": "2020-04-27T13:15:33.821Z",
"updatedAt": "2020-04-27T13:39:19.162Z"
}
Response (400 - Validation Error)
{
"validation error": "<returned validation error>"
}
Response (404 - Error Not Found)
{
"message": "<returned error message>"
}
Response (500 - Internal Server Error)
{
"message": "<returned error message>"
}
Delete todos by Id Request Header
not needed
Request Body
not needed
Response (200)
{
"id": <given id by system>,
"title": "<todos deleted title>",
"description": "<todos deleted description>",
"status": "<todos deleted status>",
"due_date": "<todos deleted due_date>",
"createdAt": "2020-04-27T13:15:33.821Z",
"updatedAt": "2020-04-27T13:39:19.162Z"
}
Response (404 - Error Not Found)
{
"message": "<returned error message>"
}
Response (500 - Internal Server Error)
{
"message": "<returned error message>"
}
Create new user to database
Request Header
{
"access_token": "<your access token>"
}
Request Body
{
"email": "<email to get insert into>",
"password": "<password to get insert into>",
}
Response (201)
{
"id": <given id by system>,
"email": "<posted email>",
"password": "<posted password>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
}
Response (500)
Login to todos
Request Header
{
"access_token": "<your access token>"
}
Request Body
{
"email": "<email to get insert into>",
"password": "<password to get insert into>",
}
Response (200)
[
{
"id": 1,
"email": "<user email>",
"password": "<user password>",
"createdAt": "2020-03-20T07:15:12.149Z",
"updatedAt": "2020-03-20T07:15:12.149Z",
},
]
Response (500 - Internal server error)