TaskLeef-API-dokumentaatio

REST-API tehtävien, projektien ja Kanban-taulujen hallintaan

Päivitetty viimeksi:

Todennus

API tukee kahta todennustapaa:

1. API-avaintodennus (suositeltu)

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 -tunnus

Selainpohjaisissa sovelluksissa todenna kirjautumispäätepisteen kautta:

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

Sisällytä tunnus sitten seuraaviin pyyntöihin:

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

Tehtävät

GET/api/todos

Hae kaikki todennetun käyttäjän tehtävät.

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

Hae tietty tehtävä tunnuksen perusteella.

GET/api/inbox

Hae tehtävät, joita ei ole liitetty mihinkään projektiin.

POST/api/todos

Luo uusi tehtävä.

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

Pyynnön runko

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

Päivitä olemassa oleva tehtävä.

PATCH/api/todos/{id}/complete

Vaihda tehtävän valmiustilaa.

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}

Poista tehtävä.

POST/api/todos/{parentId}/subtasks

Luo alitehtävä päätehtävän alle.

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

Projektit

GET/api/projects

Listaa kaikki todennetun käyttäjän projektit.

POST/api/projects

Luo uusi projekti.

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}

Hae tietty projekti tehtävineen.

PUT/api/projects/{id}

Päivitä projekti.

DELETE/api/projects/{id}

Poista projekti (tehtävät siirretään Saapuneet-kansioon).

Kanban-taulut

GET/api/boards

Listaa kaikki taulut, joihin käyttäjällä on pääsy.

POST/api/boards

Luo uusi taulu.

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}

Hae tietty taulu.

GET/api/boards/{boardId}/columns

Hae taulun kaikki sarakkeet.

GET/api/boards/{boardId}/todos

Hae kaikki tehtävät, joilla on kortteja tällä taululla.

Sarakkeet

POST/api/boards/{boardId}/columns

Luo uusi sarake tauluun.

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}

Päivitä sarake (otsikko, WIP-raja, valmiusehdot).

GET/api/columns/{columnId}/cards

Hae sarakkeen kaikki kortit.

DELETE/api/columns/{id}

Poista sarake.

Kortit

Kortit edustavat tehtäviä Kanban-taululla. Tehtävällä voi olla kortteja useilla tauluilla.

POST/api/columns/{columnId}/cards

Luo kortti tehtävälle sarakkeeseen.

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}

Päivitä kortti (siirrä toiseen sarakkeeseen tai alisarakkeeseen).

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

Alisarakkeen arvot

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

Poista kortti taululta (ei poista tehtävää).

Tunnisteet

GET/api/tags

Listaa kaikki todennetun käyttäjän tunnisteet.

POST/api/tags

Luo uusi tunniste.

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}

Päivitä tunniste.

DELETE/api/tags/{id}

Poista tunniste.

Kommentit

GET/api/todos/{todoId}/comments

Hae tehtävän kaikki kommentit.

POST/api/todos/{todoId}/comments

Lisää kommentti tehtävään.

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}

Päivitä kommentti.

DELETE/api/comments/{id}

Poista kommentti.

Vastauksen muoto

Onnistuneet vastaukset

Onnistuneet pyynnöt palauttavat JSON-muodossa pyydetyt tiedot:

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

Virhevastaukset

Virheet palauttavat asianmukaiset HTTP-tilakoodit:

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