وثائق TaskLeef API

واجهة REST API لإدارة المهام والمشاريع ولوحات Kanban

آخر تحديث:

المصادقة

تدعم واجهة API طريقتين للمصادقة:

1. المصادقة بمفتاح API (موصى بها)

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

بالنسبة للتطبيقات المعتمدة على المتصفح، صادِق عبر نقطة نهاية تسجيل الدخول:

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}

الحصول على مهمة محددة بواسطة المعرّف.

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}

حذف مشروع (تُنقل المهام إلى صندوق الوارد).

لوحات 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}

تحديث بطاقة (نقلها إلى عمود أو عمود فرعي مختلف).

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

قيم العمود الفرعي

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