The TODO application has the following APIs to create and manipulate tasks
Lists all tasks
GET http://localhost:8080/tasks
URI parameters:
Name | In | Required | Type | Description |
sortBy | Query | False | String | Field to sort by |
orderBy | Query | False | String | Order to sort by - can take the values asc or desc
|
outdatedOnly | Query | False | Boolean | Lists outdated tasks |
priority | Query | False | Integer | Priority to filter by |
Example:
GET http://localhost:8080/tasks?sortBy=dueDate&orderBy=desc&priority=3&outdatedOnly=true
Finds a task, identified by the id field
GET http://localhost:8080/tasks/{id}
URI parameters:
Name | In | Required | Type | Description |
id | Path | True | Long | Id of task to find |
Example:
GET http://localhost:8080/tasks/5
Adds a task
POST http://localhost:8080/tasks
URI parameters:
None
Request Body:
Name | Required | MediaType | Description |
requestBody | True | JSON | Task to add in JSON \
Other conditions:
|
Example:
POST http://localhost:8080/tasks
Request Body:
{
"title": "Simple task 2",
"priority": 4
}
Updates a task, identified by the id field
PATCH http://localhost:8080/tasks/{id}
URI parameters:
Name | In | Required | Type | Description |
id | Path | True | Long | Id of task to update |
Request Body:
Name | Required | MediaType | Description |
requestBody | True | JSON | Task to update in JSON \
Other conditions:
|
Example:
PATCH http://localhost:8080/tasks/3
Request Body:
{
"title": "Updated task",
"priority": 4,
"status": "Done"
}