11

I'd like to know if the Google Tasks API provides the option to move a task to a different list or if I need to create a copy of the task.

The move method seems to only allow moving within the same list.

Dan Schien
  • 1,392
  • 1
  • 17
  • 29

2 Answers2

14

The tasks API does not support moving tasks from one list to another, just changing a tasks parent task or moving it to the top of the list.

You can however get the task with /lists/tasklist_id/tasks/task_id, check each of its fields and set populate the same fields with a different tasklist_id using /lists/new_tasklist_id/tasks and then delete the old one with /lists/tasklist_id/tasks/task_id

Google also provides the Tasks API explorer which should help you experiment.

Thai Wood
  • 505
  • 4
  • 13
1

Just to confirm the answer by Thai Wood:

This is definitely the way to do it. I also moved a task using the website and and noticed that the task id changes, therefore the google website also seems to do a delete followed by a insert.

Peter C
  • 2,257
  • 2
  • 25
  • 28