Dokumentasi API TaskLeef

REST API untuk mengurus todo, projek dan papan kanban

Kemas kini terakhir:

Pengesahan

API menyokong dua kaedah pengesahan:

1. Pengesahan Kunci API (Disyorkan)

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. Token Pembawa JWT

Untuk aplikasi berasaskan pelayar, sahkan melalui titik akhir log masuk:

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

Kemudian sertakan token dalam permintaan seterusnya:

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

Todo

GET/api/todos

Dapatkan semua todo untuk pengguna yang disahkan.

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

Dapatkan todo tertentu mengikut ID.

GET/api/inbox

Dapatkan todo yang tidak ditugaskan kepada mana-mana projek.

POST/api/todos

Cipta todo baharu.

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

Badan Permintaan

MedanJenisDiperlukanPenerangan
titlestringYesTodo title
descriptionstringNoDetailed description
dueDateISO 8601NoDue date/time
prioritystringNoLow, Medium, High, or Urgent
projectIdUUIDNoAssign to a project
PUT/api/todos/{id}

Kemas kini todo sedia ada.

PATCH/api/todos/{id}/complete

Tukar status penyiapan todo.

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}

Padam todo.

POST/api/todos/{parentId}/subtasks

Cipta subtugas di bawah todo induk.

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

Projek

GET/api/projects

Senaraikan semua projek untuk pengguna yang disahkan.

POST/api/projects

Cipta projek baharu.

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}

Dapatkan projek tertentu beserta todonya.

PUT/api/projects/{id}

Kemas kini projek.

DELETE/api/projects/{id}

Padam projek (todo dialihkan ke inbox).

Papan Kanban

GET/api/boards

Senaraikan semua papan yang boleh diakses oleh pengguna.

POST/api/boards

Cipta papan baharu.

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}

Dapatkan papan tertentu.

GET/api/boards/{boardId}/columns

Dapatkan semua lajur untuk papan.

GET/api/boards/{boardId}/todos

Dapatkan semua todo yang mempunyai kad pada papan ini.

Lajur

POST/api/boards/{boardId}/columns

Cipta lajur baharu pada papan.

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}

Kemas kini lajur (tajuk, had WIP, kriteria selesai).

GET/api/columns/{columnId}/cards

Dapatkan semua kad dalam lajur.

DELETE/api/columns/{id}

Padam lajur.

Kad

Kad mewakili todo pada papan kanban. Satu todo boleh mempunyai kad pada berbilang papan.

POST/api/columns/{columnId}/cards

Cipta kad untuk todo dalam lajur.

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}

Kemas kini kad (alih ke lajur atau subColumn yang berbeza).

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

Nilai SubColumn

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

Buang kad daripada papan (tidak memadam todo).

Tag

GET/api/tags

Senaraikan semua tag untuk pengguna yang disahkan.

POST/api/tags

Cipta tag baharu.

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}

Kemas kini tag.

DELETE/api/tags/{id}

Padam tag.

Komen

GET/api/todos/{todoId}/comments

Dapatkan semua komen pada todo.

POST/api/todos/{todoId}/comments

Tambah komen pada todo.

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}

Kemas kini komen.

DELETE/api/comments/{id}

Padam komen.

Format Respons

Respons Berjaya

Permintaan yang berjaya mengembalikan JSON dengan data yang diminta:

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

Respons Ralat

Ralat mengembalikan kod status HTTP yang sesuai:

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