Tasklists: list

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

You can retrieve at most 100 tasklists per request. To retrieve the full list, pass the nextPageToken returned in a request response as a pageToken parameter to a new request. Repeat as often as necessary to page through the full list.

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 tasklists returned on one page. Optional. Partial or empty result pages are possible even before the end of the tasklist list has been reached. Acceptable values are 1 to 100, inclusive. (Default: 20)
pageToken string The token for continuing a previous list request on the next page. Optional. This should be set to the value of nextPageToken from the previous response.

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": etag,
  "nextPageToken": string,
  "items": [
    tasklists Resource
  ]
}
Property name Value Description Notes
kind string Type of the resource. This is always "tasks#taskLists".
etag etag ETag of the resource.
nextPageToken string Token that can be used to request the next page of this result. This is absent if the end of the list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
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.