Serverless function for premium-free Todoist labels
- 2 mins
I read about Bullet Journals (“BoJo”) recently. It’s more or less an analogue life journalling/task-management flow. I don’t really trust myself to write and read and keey a physical notebook (though I do have a bunch of cute small notebooks I could use for this purpose), so I had a think about how I could automate some parts of this.
For task management I currently use Todoist, which has pretty robust natural language parsing that I love (for example, to create a task in my MATH341 class due tomorrow I would write #math341 tomorrow 7pm something is due
, and it would automatically pop the into the task into the appropriate project with the correct due date). It also has nice apps for every platform out there. It also has a pretty nice developer API, which is the main thing stopping me from switching to another Todo service.
A big part of BoJo is writing down everything - tasks, events, inspirations, and whatnot. A pretty good way to do that would be with Todoist Labels… which is behind a paywall. Ugh.
Well, I noticed in somebody’s Todoist extension project that they were able to create labels and manage them for me, so it looked like the paywall was not enforced by the Todoist API. I gave it a shot:
curl "https://api.todoist.com/rest/v1/tasks/1234" -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
--data '{"labels": [2345,5678]}'
…and sure enough, it worked!
So I whipped up a simple serverless function (dubbed Labelist) to accept webhooks for task updates from Todoist, parse out @___
labels (e.g. @event
) from the content, and add the labels by API instead. So when I create an event and Todoist stubbornly refuses to add the label for me:
I just have to wait a few seconds, and Labelist will automatically add the label for me:
I’m thinking this will help me out if I pursue this further and decide to build out a reporting/reflection service for giving me a better idea of how I’m managing my time and goals.
Head over to the repository for more details!