Skip to content

Latest commit

 

History

History
112 lines (84 loc) · 5.66 KB

tasks.adoc

File metadata and controls

112 lines (84 loc) · 5.66 KB

Tasks REST API

The API endpoints for tasks in DayCaptain are as follows:

  • https://daycaptain.com/backlog-items, for backlog tasks, located in the inbox or some backlog folder

  • https://daycaptain.com/<date-iso-8601>/tasks, for day-relevant tasks, e.g. https://daycaptain.com/2021-01-01/tasks

  • https://daycaptain.com/<week-iso-8601>/tasks, for week-relevant tasks, e.g. https://daycaptain.com/2021-W05/tasks

Tip
In our tools repository, there is the todos-add cli helper, that uses the same REST API similarly to the curl commands shown on this page.

Create inbox tasks

You add a tasks that shows up in your backlogs inbox with the following HTTP call:

This is very helpful for quickly adding tasks that pop up in your head. By using this way, you don’t have to open up the program and you won’t get distracted by all the information.

curl 'https://daycaptain.com/backlog-items' \
  -XPOST -i \
  -H "Authorization: Bearer <token>" \
  -H 'Content-Type: application/json' \
  -d '{"string":"Hello Captain"}'
Tip
You can achieve the same with the following command: todos-add Hello Captain

You can add following information in the request body JSON:

JSON field

Description

Example

string

Task name (mandatory)

"string": "Hello Captain"

backlog

Backlog where to add (inbox if null)

"backlog": "To-contact"

note

Additional note

"note": "A note with a link\nhttps://google.com"

area

Task’s area

"area": "Work"

project

Task’s project

"area": "My side-hustle"

Note that you can either set an area OR a project.

Create day tasks

You add a tasks that shows up in your day view of a specific day with the following HTTP call:

This is helpful for quickly adding a task to today’s or tomorrow’s task list.

curl 'https://daycaptain.com/2021-12-31/tasks' \
  -XPOST -i \
  -H "Authorization: Bearer <token>" \
  -H 'Content-Type: application/json' \
  -d '{"string":"Celebrating new year"}'
Tip
You can achieve the same with the following command: todos-add --date 2021-12-31 Celebrating new year

URL path

Description

Example

<date>

The date in ISO-8601

https://daycaptain.com/2021-12-31/tasks

JSON field

Description

Example

string

Task name (mandatory)

"string": "Hello Captain"

planned

Planned time to spend in minutes

"planned": 60

note

Additional note

"note": "A note with a link\nhttps://google.com"

area

Task’s area

"area": "Work"

project

Task’s project

"area": "My side-hustle"

repeat

Repeating the task for n times

"repeat": 2

repeatCadence

Repeating the task every n days

"repeatCadence": 1

Note that you can either set an area OR a project.

The repeat params are optional and if set will cause the task to be repeated. If repeat is included with a non-zero amount, but repeatCadence isn’t, the default cadence is 1 (every) day.

Create week tasks

You add a tasks that shows up in your week view of a specific week with the following HTTP call:

curl 'https://daycaptain.com/2021-W01/tasks' \
  -XPOST -i \
  -H "Authorization: Bearer <token>" \
  -H 'Content-Type: application/json' \
  -d '{"string":"Plan new year resolutions"}'
Tip
You can achieve the same with the following command: todos-add --week 2021-W01 Plan new year resolutions

URL path

Description

Example

<week>

The year week in ISO-8601

https://daycaptain.com/2021-W02/tasks

JSON field

Description

Example

string

Task name (mandatory)

"string": "Hello Captain"

planned

Planned time to spend in minutes

"planned": 60

note

Additional note

"note": "A note with a link\nhttps://google.com"

area

Task’s area

"area": "Work"

project

Task’s project

"area": "My side-hustle"

repeat

Repeating the task for n times

"repeat": 2

repeatCadence

Repeating the task every n weeks

"repeatCadence": 1

Note that you can either set an area OR a project.

The repeat params are optional and if set will cause the task to be repeated. If repeat is included with a non-zero amount, but repeatCadence isn’t, the default cadence is 1 (every) week.