obsidian-todoist-plugin icon indicating copy to clipboard operation
obsidian-todoist-plugin copied to clipboard

Commans return task url

Open ShravanSunder opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. It would be good to have links to task from your notes

Describe the solution you'd like It would be great if the command to create the task returns the task url so that we can link it in the note The link could be either:

  • copied into clipboard
  • turning the selected text into a link to the task

Describe alternatives you've considered manually copying cod

ShravanSunder avatar Dec 21 '21 16:12 ShravanSunder

I agree, this would be great. Selecting obsidian text and adding a task via ⌘T gives no real feedback or indication in the obsidian note that this text is now in Todoist... but if the app returned the url, similar to "copy link to task" in Todoist, (or shift+⌘+,) to immediately paste beyond the selected text would be fantastic!

jeffkimbrel avatar Dec 02 '22 03:12 jeffkimbrel

It looks like making a new task via curl returns a json object with the task ID (id), which can just be added to the end of https://todoist.com/showTask?id= to generate the complete link.

curl https://api.todoist.com/sync/v9/items/add \
    -H "Authorization: Bearer TOKEN" \
    -d content="made via the API"

returns

{"added_at":"2022-12-02T03:17:30.011020Z","added_by_uid":"XXX","assigned_by_uid":null,"checked":false,
"child_order":7,"collapsed":false,"completed_at":null,"content":"made via the API","description":"",
"due":null,"id":"TASK_ID","is_deleted":false,"labels":[],"parent_id":null,"priority":1,"project_id":"XXX",
"responsible_uid":null,"section_id":null,"sync_id":null,"user_id":"XXX"}

And putting it together would be https://todoist.com/showTask?id=TASK_ID.

Not sure how this plug in works (probably not via curl) but whatever method it uses likely also gets a summary from the API that could be parsed into this url. Anyone have ideas?

jeffkimbrel avatar Dec 02 '22 03:12 jeffkimbrel