16. API get task
API: GET /tasks
API dùng để lấy danh sách Task với đầy đủ filter theo ngày tạo, ngày hết hạn, trạng thái, độ ưu tiên và người được giao.
Endpoint
GET https://apiring.antbuddy.com/tasks
Headers
Name
Required
Description
Content-Type
Yes
application/json
apikey
Yes
Valid API key assigned to the user.
Query Parameters
fromCreatedAt
ISO date string
2024-01-01
Lấy task có createdAt >= từ ngày.
toCreatedAt
ISO date string
2024-01-31
Lấy task có createdAt <= đến ngày.
fromDueAt
ISO date string
2024-02-01
Lấy task có dueAt >= từ ngày.
toDueAt
ISO date string
2024-02-10
Lấy task có dueAt <= đến ngày.
status
String
TO_DO,DOING,DONE,DEFERRED
Lọc theo trạng thái. Có thể truyền nhiều trạng thái, cách nhau bằng dấu phẩy.
priority
String
LOW,NORMAL,HIGH
Lọc theo độ ưu tiên. Có thể truyền nhiều độ ưu tiên, cách nhau bằng dấu phẩy.
assignTo
String
Lọc theo email của người được giao. Có thể truyền nhiều email, cách nhau bằng dấu phẩy.
page
Number
2
Chỉ định trang (dùng cho phân trang). Mặc định là 1.
limit
Number
50
Số lượng task trên mỗi trang. Mặc định là 20, tối đa là 100.
Request Example
# Lấy các task có độ ưu tiên 'high' hoặc 'normal',
# được giao cho 2 user,
# và hết hạn trong tháng 2/2024
# Lấy trang 1, 10 itemcurl
--request GET \
--location 'https://apiring.antbuddy.com/tasks?priority=HIGH,NORMAL&[email protected],[email protected]&fromDueAt=2024-02-01&toDueAt=2024-02-29&page=1&limit=10' \
--header 'Content-Type: application/json' \
--header 'apikey: YOUR_API_KEY'Response Example
{
"success": true,
"data": [
{
"_id": "664f1825e3984a1b154382b2",
"dueAt": 1716545957174,
"isCompleted": false,
"completionTime": 0,
"priority": "NORMAL",
"status": "TO_DO",
"assignTo": {
"_id": "65211474393a22650d6cb996",
"firstname": "Dai",
"lastname": "Toan",
"email": "[email protected]"
},
"category": null,
"contact": null,
"group": "652115d4393a22650d6cbb42",
"createdBy": {
"_id": "65211474393a22650d6cb996",
"firstname": "Dai",
"lastname": "Toan",
"email": "[email protected]"
},
"org": "65211476393a22650d6cb999",
"assignedAt": 1716459557420,
"createdAt": 1716459557448,
"updatedAt": 1716459557454,
"taskId": 1
}
]
}Last updated