2

I try to update a task with the following code but its not working and I do not get any feedback from it:

gapi.client.tasks.tasks.update({'task': task.id, 'tasklist': taskList.id, 'body': {'status': 'completed'}});

I successfully retrieve both tasklists and tasks, but not updating them. I have the following permission scope:

https://www.googleapis.com/auth/tasks

My question is how do I use the javascript api to do updates? Are there any guides available online?

Rob
  • 127
  • 2
  • 10

1 Answers1

2

I found a solution, you need to send the update as a second parameter to the update method:

gapi.client.tasks.tasks.update({'task': task.id, 'tasklist': taskList.id}, task).then(function (response) {});
Rob
  • 127
  • 2
  • 10
  • 1
    I find it surprising that JavaScript isn't one of the languages they include in [the documentation](https://developers.google.com/google-apps/tasks/v1/reference/tasks/update), so thanks a lot for posting this. – kevinmicke Oct 01 '17 at 16:05