API spec of to handle with list of tasks
- List
- Create
- Edit
- Delete
- GET
/tasks
- POST
/tasks
- GET
/tasks/{id}
- PUT
/tasks/{id}
- DELETE
/tasks/{id}
code | description |
---|---|
200 | OK |
201 | Created |
204 | Deleted |
404 | Not found |
422 | Unprocessable entity |
500 | Internal server error |
field | type |
---|---|
id | PK - number or uuid |
title | varchar(255) , NOT NULL |
description | text |
is_completed | boolean |
created_at | datetime ISO 8601 UTC |
modified_at | datetime ISO 8601 UTC |
status: 200
{
"data": [
{
"id": 1,
"title": "Some title",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
"is_completed": true,
"created_at": "2019-08-09T08:00:00",
"modified_at": "2019-08-09T08:00:00"
}
],
"meta": {
"per_page": 50,
"page": 1,
"total_items": 151,
"total_pages": 4
}
}
{
"data": [],
"meta": {
"per_page": 50,
"page": 1,
"total_items": 0,
"total_pages": 0
}
}
body:
{
"title": "Some title",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
"is_completed": true
}
status: 201
{
"id": 1,
"title": "Some title",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
"is_completed": true,
"created_at": "2019-08-09T08:00:00",
"modified_at": "2019-08-09T08:00:00"
}
status: 422
{
"errors": [{ "key_error": "Invalid title parse" }]
}
status: 200
{
"id": 1,
"title": "Some title",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
"is_completed": true,
"created_at": "2019-08-09T08:00:00",
"modified_at": "2019-08-09T08:00:00"
}
status: 404
no content needed
status: 422
{
"errors": [{ "key_error": "Invalid title parse" }]
}
body:
{
"title": "Some title",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
"is_completed": true
}
status: 200
{
"id": 1,
"title": "Some title",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
"is_completed": true,
"created_at": "2019-08-09T08:00:00",
"modified_at": "2019-08-09T08:00:00"
}
status: 422
{
"errors": [{ "key_error": "Invalid title parse" }]
}
status: 204
no content needed
status: 404
no content needed