Google Tasks API

Tasklists: update

Requires authorization

Updates the authenticated user's specified task list. Try it now or see an example.

Request

HTTP Request

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

Parameters

Parameter Name Value Description
Required Parameters
tasklist string Task list identifier.

Authorization

This request requires authorization with at least one of the following scopes (read more about authentication and authorization).

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

Request Body

In the request body, supply a Tasklists resource.

Response

If successful, this method returns a Tasklists resource in the response body.

Examples

Note: The code examples available for this method do not represent all supported programming languages (see the client libraries page for a list of supported languages).

Java

Uses the Java client library

// First retrieve the tasklist to update.
TaskList taskList = service.tasklists.get("taskListID").execute();
taskList.getTitle("New Task List Name");

TaskList result = service.tasklists.update(taskList.getId(), taskList).execute();
System.out.println(result.getTitle());

PHP

Uses the PHP client library

/*
 * First retrieve the tasklist to update.
 */
$tasklist = service->getTasklists('taskListID');
$tasklist->setTitle('New Task List Name');

$result = $service->updateTasklists($tasklist->getId(), $tasklist);
echo $result->getTitle();

Python

Uses the Python client library

# First retrieve the tasklist to update.
tasklist = service.tasklists().get(tasklist='taskListID').execute()
tasklist['title'] = 'New Task List Name'

result = service.tasklists().update(tasklist=tasklist['id'], body=tasklist).execute()
print result['title']

.NET

Uses the .NET client library

// First retrieve the tasklist to update.
TaskList taskList = service.Tasklists.Get("taskListID").Fetch();
taskList.Title = "New Task List Name";

TaskList result = service.Tasklists.Update(taskList, taskList.Id).Fetch();
Console.WriteLine(result.Title);

Try It!

Use the explorer below to call this method on live data and see the response. Alternatively, try the standalone explorer.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.