API Demonstration

API Documentation

Git repo

https://gitlab.com/vgogolin/doit_test

API_URL

https://doit.bbrok.com/api/

Sign up

POST {API_URL}authentification/signup { "user" : string, "password" : string }
Response:
200: { "user" : string, "token" : string }
400: String error message

Sign in

POST {API_URL}authentification/signin { "user" : string, "password" : string }
Response:
200: { "user" : string, "token" : string }
400: String error message

View tasks list

GET {API_URL}tasks/list
Without filters all tasks will be listed
Optional filters: { "sortby" : string, "showcount" : int, "startfrom" : int }
Sortby: 'time', 'title', 'duedate', 'priority', 'status'
Task: { "title" : string, "duedate" : string YYYY-MM-DD, "priority" : string, "status" : string, "id" : int }
Priority: 'low', 'normal', 'high'
Status: 'new', 'done'
Requires: Authorization header
Response:
200: { "user" : string, "tasks" : array, "count" : int }
400: String error message

Pagination and sorting

You can implement any splits using startfrom and showcount options:
Example page1: GET {API_URL}tasks/list { "showcount" : 10, "startfrom" : 1 }
Example page2: GET {API_URL}tasks/list { "showcount" : 10, "startfrom" : 11 }
Requires: Authorization header
Response:
200: { "user" : string, "tasks" : array, "count" : int }
400: String error message

"Count" shows total amount of all user tasks.

You can presort the tasks using "Sortby" filter:
GET {API_URL}tasks/list { "sortby" : "duedate", "showcount" : 10, "startfrom" : 11 }
Add "sortdesc" for descending order:
GET {API_URL}tasks/list { "sortby" : "duedate", "sortdesc" : true , "showcount" : 10, "startfrom" : 11 }

Create task

POST {API_URL}tasks/create { "title" : string, "duedate" : string YYYY-MM-DD, "priority" : string low|normal|high }
Requires: Authorization header
Response:
200: ok
400: String error message

Mark as done

PATCH {API_URL}tasks/mark (int)TaskID
Requires: Authorization header
Response:
200: ok
400: String error message

Delete task

DELETE {API_URL}tasks/delete (int)TaskID
Requires: Authorization header
Response:
200: ok
400: String error message

< / Documentation >