Todoist Client for Google Apps Script.
Use Todoist Sync API.
NOW, only add_item
command is implemented.
- Create or Open your GAS project.
- Cliock Add Library link, then Library daialog is opened.
- Input
1EMZVgA58kI-yF2-mB8r14-dTk0D4cia9tRc9X2_lpiWO3IqRq6eWBg-S
, and click Add button. - Select library version.
- Change Identifier of this library to
Todoist
- Click Save button.
Get API Token TODOIST_TOKEN
in https://todoist.com/app/settings/integrations/developer .
Some samples is below.
// create a single task.
function addSingleItem() {
const task: Todoist.ItemAddArgs = {
content: 'Single Item',
};
const todoist = new Todoist.Client(TODOIST_TOKEN);
const addedItem = todoist.addItem(task);
}
// create a single task with a note.
function addItemWithNote() {
const item: Todoist.ItemAddArgs = {
content: 'Item with Note',
};
const note: Todoist.NoteAddArgs = {
content: 'Note !',
};
const todoist = new Todoist.Client(TODOIST_TOKEN);
const addedItem = todoist.addItem(item, note);
}
- Node.js
- Yarn
- Clone this ripository.
- Install dependencies by
yarn install
- Create your GAS project, push code, and open web editor.
$ yarn clasp:create --title gas-todoist --type standalone --rootDir src $ yarn clasp:push $ yarn clasp:open