This API provides endpoints for managing todo items, including creation, retrieval, updates, and deletion of todos. The API follows RESTful principles and uses JSON for request and response bodies.
http://localhost:8080
Currently, the API is open and doesn't require authentication. Future versions will implement JWT-based authentication.
200 OK: Request successful201 Created: Resource created successfully400 Bad Request: Invalid request payload404 Not Found: Resource not found409 Conflict: Resource already exists500 Internal Server Error: Server error
Check the API's health status.
Response
{
"status": "ok",
"time": "2024-11-15T10:00:00Z"
}Retrieve all todos.
Response
[
{
"id": "1",
"task": "Complete project",
"status": "IN_PROGRESS",
"priority": "high",
"dueDate": "2024-12-31T23:59:59Z",
"createdAt": "2024-11-15T10:00:00Z",
"updatedAt": "2024-11-15T10:00:00Z"
}
]Create a new todo.
Request Body
{
"task": "Complete project",
"priority": "high",
"dueDate": "2024-12-31T23:59:59Z"
}Response (201 Created)
{
"message": "Todo created successfully",
"task": "Complete project"
}Update a todo's status.
Request Body
{
"item": "Complete project",
"status": "IN_PROGRESS"
}Valid Status Values
- TO_BE_STARTED
- IN_PROGRESS
- COMPLETED
Response
{
"message": "Todo status updated successfully",
"item": "Complete project",
"status": "IN_PROGRESS"
}Delete a todo.
Request Body
{
"item": "Complete project"
}Response
{
"message": "Todo deleted successfully",
"item": "Complete project"
}Get todos filtered by priority level.
Parameters
priority(path): Priority level (low, medium, high)
Response
[
{
"id": "1",
"task": "Complete project",
"status": "IN_PROGRESS",
"priority": "high",
"dueDate": "2024-12-31T23:59:59Z",
"createdAt": "2024-11-15T10:00:00Z",
"updatedAt": "2024-11-15T10:00:00Z"
}
]Search todos based on a query string.
Parameters
q(query): Search term
Example
GET /search?q=project
Response
[
{
"id": "1",
"task": "Complete project",
"status": "IN_PROGRESS",
"priority": "high",
"dueDate": "2024-12-31T23:59:59Z",
"createdAt": "2024-11-15T10:00:00Z",
"updatedAt": "2024-11-15T10:00:00Z"
}
]{
"id": "string",
"task": "string",
"status": "string",
"priority": "string",
"dueDate": "string (ISO 8601)",
"createdAt": "string (ISO 8601)",
"updatedAt": "string (ISO 8601)",
"completedAt": "string (ISO 8601)"
}{
"task": "string (required, 3-100 chars)",
"priority": "string (low, medium, high)",
"dueDate": "string (ISO 8601)"
}{
"error": "Error message description"
}- "Task cannot be empty"
- "Todo item already exists"
- "Invalid status"
- "Todo item not found"
- "Invalid request payload"
The API currently doesn't implement rate limiting. Future versions will include rate limiting headers:
- X-RateLimit-Limit
- X-RateLimit-Remaining
- X-RateLimit-Reset
For endpoints that return lists (GET /todo, GET /search), pagination will be implemented in future versions using:
- page (query parameter)
- limit (query parameter)
- total (response header)
- Always include Content-Type header in requests
- Handle HTTP 429 (Too Many Requests) in clients
- Implement exponential backoff for failed requests
- Cache GET responses when appropriate
- Use appropriate HTTP methods for operations
- Authentication and Authorization
- Pagination
- Rate Limiting
- Batch Operations
- Webhooks for Status Changes
- Rich Text Descriptions
- File Attachments
- Categories and Tags