knitr::opts_chunk$set( eval=FALSE, collapse = TRUE, comment = "#>" )
The first step is to retrieve a token.
Open todoist website to find it :
library(rtodoist) rtodoist::open_todoist_website_profile() token <- "YOURTOKEN" # copied and pasted from website library(lubridate)
We use {keyring} features to do it.
set_todoist_api_token(token)
Don't forget to store the result to reuse the identifier of the new project.
id_proj <- add_project(project_name = "test",verbose = TRUE)
id_proj %>% add_tasks_in_project("my_tasks")
id_proj %>% add_users_in_project(users_email = "your@mail.fr")
id <- add_project(project_name = "test",verbose = TRUE) %>% add_tasks_in_project(tasks = c("First task", "Second task") ) id <- add_project(project_name = "test",verbose = TRUE) %>% add_tasks_in_project(tasks = c("First task", "Second task") ) id %>% add_responsible_to_task("First task", add_responsible = "user2@mail.com")
You can set multiple task at ones, you can set muliple responsibles, due dates and section if you use vectors, the order is important, and the matching will be done term by term
multiple tasks for one responsible with one due dates
id_proj %>% add_tasks_in_project(tasks = c("t1","t2"),responsible = c("user1@mail.com"),due = today())
multiple tasks for one responsible with multiple due dates
id_proj %>% add_tasks_in_project(tasks = c("t1","t2"),responsible = c("user1@mail.com"),due = today() + days(1:2))
multiple tasks for multiple responsible with on due dates on many section
id_proj %>% add_tasks_in_project(tasks = c("t1","t2"),responsible = c("user1@mail.com","user2@mail.com"),due = lubridate::today(),section_name = c("S1","S2"))
you can pass a data.frame using add_tasks_in_project_from_df
tasks_df <- data.frame( "tasks" = LETTERS[1:5], "responsible" = glue::glue("user{1:5}@mail.com"), "due" = today()+ days(1:5), "section_name" = c("S1","S1","S3","S3","S3") ) add_tasks_in_project_from_df(project_id = id_proj,tasks_as_df = tasks_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.