เอกสาร TaskLeef API

REST API สำหรับจัดการงาน โปรเจกต์ และบอร์ด Kanban

อัปเดตล่าสุด:

การยืนยันตัวตน

API รองรับวิธีการยืนยันตัวตนสองแบบ:

1. การยืนยันตัวตนด้วย API Key (แนะนำ)

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

สำหรับแอปพลิเคชันบนเบราว์เซอร์ ให้ยืนยันตัวตนผ่านปลายทางเข้าสู่ระบบ:

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

จากนั้นแนบโทเค็นไว้ในคำขอถัดไป:

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

งาน

GET/api/todos

ดึงงานทั้งหมดของผู้ใช้ที่ยืนยันตัวตนแล้ว

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

ดึงงานที่ต้องการตาม ID

GET/api/inbox

ดึงงานที่ยังไม่ได้กำหนดให้โปรเจกต์ใด

POST/api/todos

สร้างงานใหม่

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

เนื้อหาคำขอ

ฟิลด์ประเภทจำเป็นคำอธิบาย
titlestringYesTodo title
descriptionstringNoDetailed description
dueDateISO 8601NoDue date/time
prioritystringNoLow, Medium, High, or Urgent
projectIdUUIDNoAssign to a project
PUT/api/todos/{id}

อัปเดตงานที่มีอยู่

PATCH/api/todos/{id}/complete

สลับสถานะการทำงานเสร็จของงาน

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}

ลบงาน

POST/api/todos/{parentId}/subtasks

สร้างงานย่อยภายใต้งานหลัก

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

โปรเจกต์

GET/api/projects

แสดงรายการโปรเจกต์ทั้งหมดของผู้ใช้ที่ยืนยันตัวตนแล้ว

POST/api/projects

สร้างโปรเจกต์ใหม่

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}

ดึงโปรเจกต์ที่ต้องการพร้อมงานในนั้น

PUT/api/projects/{id}

อัปเดตโปรเจกต์

DELETE/api/projects/{id}

ลบโปรเจกต์ (งานจะถูกย้ายไปยัง inbox)

บอร์ด Kanban

GET/api/boards

แสดงรายการบอร์ดทั้งหมดที่ผู้ใช้เข้าถึงได้

POST/api/boards

สร้างบอร์ดใหม่

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}

ดึงบอร์ดที่ต้องการ

GET/api/boards/{boardId}/columns

ดึงคอลัมน์ทั้งหมดของบอร์ด

GET/api/boards/{boardId}/todos

ดึงงานทั้งหมดที่มีการ์ดอยู่บนบอร์ดนี้

คอลัมน์

POST/api/boards/{boardId}/columns

สร้างคอลัมน์ใหม่บนบอร์ด

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}

อัปเดตคอลัมน์ (ชื่อ ลิมิต WIP เกณฑ์เสร็จสิ้น)

GET/api/columns/{columnId}/cards

ดึงการ์ดทั้งหมดในคอลัมน์

DELETE/api/columns/{id}

ลบคอลัมน์

การ์ด

การ์ดแทนงานบนบอร์ด Kanban หนึ่งงานสามารถมีการ์ดได้บนหลายบอร์ด

POST/api/columns/{columnId}/cards

สร้างการ์ดสำหรับงานในคอลัมน์

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}

อัปเดตการ์ด (ย้ายไปยังคอลัมน์หรือ subColumn อื่น)

# 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}

ค่าของ SubColumn

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

ลบการ์ดออกจากบอร์ด (ไม่ลบงาน)

แท็ก

GET/api/tags

แสดงรายการแท็กทั้งหมดของผู้ใช้ที่ยืนยันตัวตนแล้ว

POST/api/tags

สร้างแท็กใหม่

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}

อัปเดตแท็ก

DELETE/api/tags/{id}

ลบแท็ก

ความคิดเห็น

GET/api/todos/{todoId}/comments

ดึงความคิดเห็นทั้งหมดบนงาน

POST/api/todos/{todoId}/comments

เพิ่มความคิดเห็นในงาน

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}

อัปเดตความคิดเห็น

DELETE/api/comments/{id}

ลบความคิดเห็น

รูปแบบการตอบกลับ

การตอบกลับสำเร็จ

คำขอที่สำเร็จจะตอบกลับเป็น JSON พร้อมข้อมูลที่ร้องขอ:

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

การตอบกลับข้อผิดพลาด

ข้อผิดพลาดจะตอบกลับด้วยรหัสสถานะ HTTP ที่เหมาะสม:

  • 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.