Tasklists: list

Returns all the authenticated user's task lists. Try it now or see an example.

Request

HTTP request

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

Parameters

Parameter name Value Description
Optional query parameters
maxResults long Maximum number of task lists returned on one page. Optional. The default is 20 (max allowed: 100).
pageToken string Token specifying the result page to return. Optional.

Authorization

This request requires authorization with at least one of the following scopes:

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

For more information, see the authentication and authorization page.

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "tasks#taskLists",
  "etag": string,
  "nextPageToken": string,
  "items": [
    tasklists Resource
  ]
}
Property name Value Description Notes
kind string Type of the resource. This is always "tasks#taskLists".
etag string ETag of the resource.
nextPageToken string Token that can be used to request the next page of this result.
items[] list Collection of task lists.

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.

TaskLists taskLists = service.tasklists.list().execute();

for (TaskList taskList : taskLists.getItems()) {
  System.out.println(taskList.getTitle());
}

PHP

Uses the PHP client library.

$taskLists = $service->listTasklists();

foreach ($taskLists->getItems() as $taskList) {
  echo $taskList->getTitle();
}

Python

Uses the Python client library.

tasklists = service.tasklists().list().execute()

for tasklist in tasklists['items']:
  print tasklist['title']

.NET

Uses the .NET client library.

TaskLists results = service.Tasklists.List().Fetch();

foreach (TaskList list in results.Items)
{
  Console.WriteLine(list.Title);
}

Try it!

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