Todo REST Service (1.0)

Download OpenAPI specification:

Users

Register a user

Register a user

Request Body schema: application/json
required

the user credentials

name
required
string[A-Za-z0-9]+
password
required
string <password> >= 5 characters

Responses

Request samples

Content type
application/json
{
  • "name": "alice",
  • "password": "12345"
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "details": "string"
}

Authenticate a user

Authenticate a user

Authorizations:
BasicAuth

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "details": "string"
}

Categories

Get the todo categories

Get the todo categories

Responses

Response samples

Content type
application/json
[
  • "WORK",
  • "HOME",
  • "PERSONAL",
  • "HEALTH",
  • "FINANCE"
]

Todos

Get the todos

Get the todos

Authorizations:
BasicAuth
query Parameters
category
string
Enum: "WORK" "HOME" "PERSONAL" "HEALTH" "FINANCE"
Example: category=HOME

the category of the todos

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Add a todo

Add a todo

Authorizations:
BasicAuth
Request Body schema: application/json
required

the data of the todo

title
required
string[\p{L}\p{N} ]+
category
string
Enum: "WORK" "HOME" "PERSONAL" "HEALTH" "FINANCE"
dueDate
string <date>

Responses

Request samples

Content type
application/json
{
  • "title": "Buy milk",
  • "category": "HOME",
  • "dueDate": "2025-01-01"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Buy milk",
  • "category": "HOME",
  • "dueDate": "2025-01-01",
  • "completed": false
}

Get a todo

Get a todo

Authorizations:
BasicAuth
path Parameters
id
required
integer
Example: 1

the identifier of the todo

Responses

Response samples

Content type
application/json
{
  • "title": "Buy milk",
  • "category": "HOME",
  • "dueDate": "2025-01-01",
  • "completed": false
}

Update a todo

Update a todo

Authorizations:
BasicAuth
path Parameters
id
required
integer
Example: 1

the identifier of the todo

Request Body schema: application/json
required

the new data of the todo

id
integer
title
required
string[\p{L}\p{N} ]+
category
string
Enum: "WORK" "HOME" "PERSONAL" "HEALTH" "FINANCE"
dueDate
string <date>
completed
boolean

Responses

Request samples

Content type
application/json
{
  • "id": 1,
  • "title": "Buy milk",
  • "category": "HOME",
  • "dueDate": "2025-01-01",
  • "completed": true
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Buy milk",
  • "category": "HOME",
  • "dueDate": "2025-01-01",
  • "completed": true
}

Update the status of a todo

Update the status of a todo

Authorizations:
BasicAuth
path Parameters
id
required
integer
Example: 1

the identifier of the todo

Request Body schema: application/json
required

the status of the todo

completed
required
boolean

Responses

Request samples

Content type
application/json
{
  • "completed": true
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Buy milk",
  • "category": "HOME",
  • "dueDate": "2025-01-01",
  • "completed": true
}

Remove a todo

Remove a todo

Authorizations:
BasicAuth
path Parameters
id
required
integer
Example: 1

the identifier of the todo

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "details": "string"
}