Introduction
The Todo API allows you to manage your todo lists programmatically. Below are the available endpoints and their usage.
Authentication
All endpoints require a valid API key. Include the API key in the Authorization header of your requests:
Authorization: Bearer {api_key}
To obtain an API key, register on our website and navigate to the API keys section of your account settings.
API Endpoints
GET /todos
Fetches all todo items.
GET https://todo-api-yry4.onrender.com/todos
POST /todos
Creates a new todo item. Add the content in the request JSON body.
POST https://todo-api-yry4.onrender.com/todos
Headers:
Authorization: Bearer {api_key}
Body:
{
"title": "Buy groceries"
}
GET /todos/:id
Fetches a single todo item by its ID.
GET https://todo-api-yry4.onrender.com/todos/{id}
Headers:
Authorization: Bearer {api_key}
PATCH /todos/:id
Updates a todo item by its ID. You can update the title or the completion status. Add the content in the request JSON body.
PATCH https://todo-api-yry4.onrender.com/todos/{id}
Headers:
Authorization: Bearer {api_key}
Body:
{
"completed": true
}
(or)
you can update the title too..
Headers:
Authorization: Bearer {api_key}
Body:
{
"title":"updated title",
"completed": true
}
DELETE /todos/:id
Deletes a todo item by its ID.
DELETE https://todo-api-yry4.onrender.com/todos/{id}
Headers:
Authorization: Bearer {api_key}
Examples
Here are some example requests you can try using Thunder Client or Postman:
Create a Todo
POST /todos
Headers:
Authorization: Bearer {api_key}
Body:
{
"title": "Buy groceries"
}
Get All Todos
GET /todos
Headers:
Authorization: Bearer {api_key}
Error Codes
Below are some common error codes you might encounter:
- 400 Bad Request: The request could not be understood or was missing required parameters.
- 401 Unauthorized: Authentication failed or user does not have permissions for the desired action.
- 404 Not Found: The requested resource could not be found.
- 500 Internal Server Error: An error occurred on the server.
Rate Limiting
You can make up to 100 requests per hour. Exceeding this limit will result in a 429 Too Many Requests response.
Versioning
The current version of the API is v1. Specify the version in the URL, e.g., /v1/todos
. Deprecated endpoints will be removed after a notice period.
Use Cases
Here are some scenarios where you can use the Todo API:
- Personal Task Management: Manage your daily tasks and to-do lists.
- Team Collaboration: Share and manage tasks within a team.
- Project Management: Track project tasks and deadlines.
- Productivity Apps: Integrate with productivity tools for better task management.
- Reminder Services: Create reminders for important tasks.
- Automated Task Scheduling: Automate task creation and updates.
- Time Management: Track and manage time spent on tasks.
- Client Management: Manage tasks for client projects.
- Learning and Development: Track learning goals and progress.
- Event Planning: Organize tasks for events and activities.
Glossary
- API Key: A unique key used to authenticate requests.
- Endpoint: A specific URL where API requests are sent.
- Rate Limiting: Restricting the number of API requests within a time period.
- Versioning: Managing changes to the API by releasing different versions.
- HTTP Method: The action to be performed on the resource (GET, POST, PATCH, DELETE).
Feedback
We value your feedback! Please email us with any questions or suggestions.