Tài liệu API TaskLeef

REST API để quản lý việc cần làm, dự án và bảng kanban

Cập nhật lần cuối:

Xác thực

API hỗ trợ hai phương thức xác thực:

1. Xác thực bằng Khóa API (Khuyến nghị)

Generate an API key from your Settings page and include it in the X-API-Key header:

curl -H "X-API-Key: your-api-key" \
  https://taskleef.com/api/todos

2. JWT Bearer Token

Đối với ứng dụng dựa trên trình duyệt, hãy xác thực qua điểm cuối đăng nhập:

curl -X POST https://taskleef.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": "your-username", "password": "your-password"}'

Sau đó đính kèm token vào các yêu cầu tiếp theo:

curl -H "Authorization: Bearer your-jwt-token" \
  https://taskleef.com/api/todos

Việc cần làm

GET/api/todos

Lấy tất cả việc cần làm của người dùng đã xác thực.

curl -H "X-API-Key: your-api-key" \
  https://taskleef.com/api/todos
GET/api/todos/{id}

Lấy một việc cần làm cụ thể theo ID.

GET/api/inbox

Lấy các việc cần làm chưa được gán vào dự án nào.

POST/api/todos

Tạo một việc cần làm mới.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "Buy groceries", "description": "Milk, eggs, bread"}' \
  https://taskleef.com/api/todos

Nội dung Yêu cầu

TrườngKiểuBắt buộcMô tả
titlestringYesTodo title
descriptionstringNoDetailed description
dueDateISO 8601NoDue date/time
prioritystringNoLow, Medium, High, or Urgent
projectIdUUIDNoAssign to a project
PUT/api/todos/{id}

Cập nhật một việc cần làm hiện có.

PATCH/api/todos/{id}/complete

Bật/tắt trạng thái hoàn thành của việc cần làm.

curl -X PATCH -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"isCompleted": true}' \
  https://taskleef.com/api/todos/{id}/complete
DELETE/api/todos/{id}

Xóa một việc cần làm.

POST/api/todos/{parentId}/subtasks

Tạo một tác vụ con dưới một việc cần làm cha.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "Subtask title"}' \
  https://taskleef.com/api/todos/{parentId}/subtasks

Dự án

GET/api/projects

Liệt kê tất cả dự án của người dùng đã xác thực.

POST/api/projects

Tạo một dự án mới.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "Work Tasks", "description": "Tasks for work"}' \
  https://taskleef.com/api/projects
GET/api/projects/{id}

Lấy một dự án cụ thể cùng các việc cần làm của nó.

PUT/api/projects/{id}

Cập nhật một dự án.

DELETE/api/projects/{id}

Xóa một dự án (việc cần làm được chuyển về hộp thư đến).

Bảng Kanban

GET/api/boards

Liệt kê tất cả bảng mà người dùng có quyền truy cập.

POST/api/boards

Tạo một bảng mới.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "Sprint Board", "projectId": "project-uuid"}' \
  https://taskleef.com/api/boards
GET/api/boards/{id}

Lấy một bảng cụ thể.

GET/api/boards/{boardId}/columns

Lấy tất cả cột của một bảng.

GET/api/boards/{boardId}/todos

Lấy tất cả việc cần làm có thẻ trên bảng này.

Cột

POST/api/boards/{boardId}/columns

Tạo một cột mới trên bảng.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "In Progress", "wipLimit": 3}' \
  https://taskleef.com/api/boards/{boardId}/columns
PUT/api/columns/{id}

Cập nhật một cột (tiêu đề, giới hạn WIP, tiêu chí hoàn thành).

GET/api/columns/{columnId}/cards

Lấy tất cả thẻ trong một cột.

DELETE/api/columns/{id}

Xóa một cột.

Thẻ

Thẻ đại diện cho các việc cần làm trên bảng kanban. Một việc cần làm có thể có thẻ trên nhiều bảng.

POST/api/columns/{columnId}/cards

Tạo một thẻ cho việc cần làm trong một cột.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"todoId": "todo-uuid"}' \
  https://taskleef.com/api/columns/{columnId}/cards
PUT/api/cards/{id}

Cập nhật một thẻ (chuyển sang cột hoặc cột con khác).

# Move card to a different column
curl -X PUT -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"columnId": "new-column-uuid", "subColumn": "Inbox"}' \
  https://taskleef.com/api/cards/{id}

# Move card to Done subColumn
curl -X PUT -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"subColumn": "Done"}' \
  https://taskleef.com/api/cards/{id}

Giá trị Cột con

  • Inbox - Active items in the column
  • Done - Completed items within the column
  • Blocked - Items waiting on external dependencies
DELETE/api/cards/{id}

Gỡ một thẻ khỏi bảng (không xóa việc cần làm).

Thẻ phân loại

GET/api/tags

Liệt kê tất cả thẻ phân loại của người dùng đã xác thực.

POST/api/tags

Tạo một thẻ phân loại mới.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"name": "urgent"}' \
  https://taskleef.com/api/tags
PUT/api/tags/{id}

Cập nhật một thẻ phân loại.

DELETE/api/tags/{id}

Xóa một thẻ phân loại.

Bình luận

GET/api/todos/{todoId}/comments

Lấy tất cả bình luận trên một việc cần làm.

POST/api/todos/{todoId}/comments

Thêm một bình luận vào một việc cần làm.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"text": "This is my comment"}' \
  https://taskleef.com/api/todos/{todoId}/comments
PUT/api/comments/{id}

Cập nhật một bình luận.

DELETE/api/comments/{id}

Xóa một bình luận.

Định dạng Phản hồi

Phản hồi Thành công

Các yêu cầu thành công trả về JSON chứa dữ liệu được yêu cầu:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "Buy groceries",
  "description": "Milk, eggs, bread",
  "isCompleted": false,
  "createdAt": "2024-01-15T10:30:00Z"
}

Phản hồi Lỗi

Lỗi trả về mã trạng thái HTTP phù hợp:

  • 400 - Bad Request (invalid input)
  • 401 - Unauthorized (missing or invalid authentication)
  • 403 - Forbidden (insufficient permissions)
  • 404 - Not Found
  • 500 - Internal Server Error

Need help? Check your Settings to manage API keys.