Tasks: get

Returns the specified task. Try it now or see an example.

Request

HTTP request

GET https://www.googleapis.com/tasks/v1/lists/tasklist/tasks/task

Parameters

Parameter name Value Description
Path parameters
task string Task identifier.
tasklist string Task list identifier.

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

Task task = service.tasks.get("@default", "taskID").execute();

System.out.println(task.getTitle());

PHP

Uses the PHP client library.

$task = $service->getTasks('taskID', '@default');

echo $task->getTitle();

Python

Uses the Python client library.

task = service.tasks().get(tasklist='@default', task='taskID').execute()

print task['title']

.NET

Uses the .NET client library.

Task task = service.Tasks.Get("@default", "taskID").Fetch();
Console.WriteLine(task.Title);

Try it!

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