+ Add Question

Selecting all tasks with a particular label using the API


Is it possible to use the API to return a list of all tasks with a particular label?

The reason I ask is that it would allow location-based reminders on Android, using Tasker or alternatives: if I have labels for geographic locations, such as "office", then Tasker could use a geofence to determine when I was at the office, and if I was fire off reminders for all the tasks labelled like that.

But my programming skills don't extend far beyond simple scripting, and it's not clear from the API description if I could manage this.

All responses

David Trey  staff
Replied on Mar 10, 2014 - 13:44 UTC

Hello Andrew,

I've passed your question to the developer and will let you know as soon as they reply.

Bets regards,

Amir Salihefendic  staff in training
Replied on Mar 10, 2014 - 14:12 UTC

Hi Andrew

You can use /API/query

Best regards,

Mike Baran  premium
Replied on May 19, 2014 - 13:31 UTC

Please show an example. I'm not getting the correct syntax in the JSON per the returned error message

David Trey  staff
Replied on May 19, 2014 - 14:01 UTC

Hello Mike,

Here's an example based on our documentation as described at https://todoist.com/API/#query - this will search for all tasks with a label named "test":


Of course, please remember to include your token in every query.

Best regards,

Mike Baran  premium
Replied on May 19, 2014 - 18:33 UTC

The example is great. I suggest the example in the documentation should be
updated since it was not clear that the argument of the queries array needs
to be quoted.