GabrieleMartini
GabrieleMartini

Reputation: 1721

Google Tasks API PHP: update tasks return 404 not found

Following the example at Google Reference (see below), the update return "404 not found". Here is the code as per Google Reference at now:

$task = $service->getTasks('@default', 'taskID');
$task->setStatus('completed');
$result = $service->updateTasks($task->getId(), '@default', $task);
echo $result->getCompleted();

Upvotes: 0

Views: 196

Answers (1)

GabrieleMartini
GabrieleMartini

Reputation: 1721

I resolved: at the moment I write, there is an error in Google Reference. This is how I resolved in my code:

 $task = $service->tasks->get('@default', 'taskID');
 $task->setStatus('completed');
 $result = $service->tasks->update('@default', $task->getId(), $task);

Parameter @default has to be the first, and taskId has to be the second.

Upvotes: 2

Related Questions