Google Tasks API

Tasklists: list

Requires authorization

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 Parameters
maxResults long Maximum number of task lists returned on one page. Optional. The default is 100.
pageToken string Token specifying the result page to return. Optional.

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
https://www.googleapis.com/auth/tasks.readonly

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 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.