Drafts Script Reference

Todoist

Script integration with Todoist. This object handles OAuth authentication and request signing. The entire Todoist REST API can be used with the request method, and convenience methods are provided for common API endpoints to manage tasks, projects, comments and labels.

The quickAdd method is mostly likely what you are looking for to create tasks as it supports the shorthand the task entry box in Todoist supports to parse projects, etc.

Other methods are direct mappings of the REST API calls provided by Todoist. Most take an options parameter which is a javascript object containing the parameters to be passed to the API, and and the method decodes the JSON response from Todoist and returns it as a Javascript object (or array of objects) with the values as specified in the Todoist API docs.

If an API calls fails, typically the result will be an undefined value, and the lastError property will contains error detail information for troubleshooting.

Properties

Convenience Functions

Quick Add

Tasks

Projects

Comments

Labels

Functions

Class Functions

Examples

See Examples-Todoist action group in the Action Directory.

// create Todoist object
let todoist = Todoist.create();
// create task in inbox
todoist.createTask({
  "content": "My Task Name",
  "due_string": "Next wednesday"
});