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 = {
'method': 'PUT',
'headers': {
'Content-type': 'application/json'
},
'body': JSON.stringify(task)
};
var addDone = function(resp, xhr) {
if (xhr.status != 200) {
notifyFailure('Couldn\'t update task.', xhr.status);
return;
}
//notifySuccess(task['title']);
}
oauth.sendSignedRequest(url, addDone, req);
}
I get the following error however:
"{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid Value"
}
],
"code": 400,
"message": "Invalid Value"
}
}
"
The update body is this:
{
'title': $(this).val()
};
I am using the chrome_ex_oauth api and could use some help.