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 |
---|---|---|
Path parameters | ||
tasklist |
string |
Task list identifier. |
Authorization
This request requires authorization with the following scope:
Scope |
---|
https://www.googleapis.com/auth/tasks |
For more information, see the authentication and authorization page.
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 APIs Explorer below to call this method on live data and see the response. Alternatively, try the standalone Explorer.