Skip to content Skip to sidebar Skip to footer

Google Tasks Update Error

I am attempting to update a task with the following code: function updtsk(task,id) { var url = 'https://www.googleapis.com/tasks/v1/lists/@default/tasks/'+id; var req = {

Solution 1:

Try passing the 'id' key/value pair together with the title information you are already sending.

I had this same problem, even using the API explorer. There's no documentation to indicate this is a required parameter, especially since it is included in the URL. Once I added id, it worked properly.

Solution 2:

It's possible you need to include additional fields in the update.

The documentation here: http://code.google.com/apis/tasks/v1/reference.html#resource_tasks appears to indicate the status property is not optional (the other mutable fields are listed as optional in their descriptions). You may also need to include the kind property with the static value indicated there.

Solution 3:

In Google Task API for updating any TaskList Task: First we have to get task with use of TaskList Id and Task Id Second step change/update in task and again update that task. Hope this is helpful for you.

Solution 4:

I read these answers several times, but only saw what I thought I already knew, which was wrong. The documentation for insert/update/etc. states

POST https://www.googleapis.com/tasks/v1/lists/tasklist/tasks

It is the id of the tasklist being modified (e.g. something like "MTA1MjEpoqwdNTMzMjAzo349YDA6MDow") and not the title of the tasklist e.g. "My Task List" that needs to be passed in the POST request header, e.g.

POST https://www.googleapis.com/tasks/v1/lists/MTA1MjEpoqwdNTMzMjAzo349YDA6MDow/tasks

You can find the id of the list by doing a tasklists 'list' query.

GET https://www.googleapis.com/tasks/v1/users/@me/lists

which returns, e.g. something like this:

{
   "kind": "tasks#taskList",
   "id": "MTA1MjEpoqwdNTMzMjAzo349YDA6MDow",
   "title": "My Task List",
   "updated": "2019-03-15T21:21:03.000Z",
   "selfLink": "https://www.googleapis.com/tasks/v1/users/@me/lists/MTA1MjE0Njc5NTMzMjA1NDk0NDA6MDM1NDgwMjIxODgyMjcyODow"
  }

You can see the tasklist id in the response, which can then be used in the POST to modify the desired tasklist. Answers to this question have been posted, but none with explicit examples. Hopefully this example will help someone get past this newbie kind of problem.

Post a Comment for "Google Tasks Update Error"