Skip to content

Latest commit

 

History

History
188 lines (144 loc) · 6.84 KB

File metadata and controls

188 lines (144 loc) · 6.84 KB
title outlookTask: complete
description Complete an Outlook task which sets the **completedDateTime** property to the current date,
ms.localizationpriority medium
author mashriv
ms.subservice outlook
doc_type apiPageType
ms.date 04/04/2024

outlookTask: complete (deprecated)

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

[!INCLUDE outlooktask-deprecate-allup]

Complete an Outlook task which sets the completedDateTime property to the current date, and the status property to completed.

If you are completing a task in a recurring series, in the response, the task collection will contain the completed task in the series, and the next task in the series.

The completedDateTime property represents the date when the task is finished. The time portion of completedDateTime is set to midnight UTC by default.

By default, this operation (and the POST, GET, and PATCH task operations) returns date-related properties in UTC. You can use the Prefer: outlook.timezone header to have all the date-related properties in the response represented in a time zone different than UTC.

[!INCLUDE national-cloud-support]

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

HTTP request

POST /me/outlook/tasks/{id}/complete
POST /users/{id|userPrincipalName}/outlook/tasks/{id}/complete

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Prefer: outlook.timezone Specifies the time zone for time properties in the response, which would be in UTC if this header is not specified. Optional.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns 200 OK response code and the outlookTask object in the response body.

Example

The following example marks the specified task as complete. It specifies Pacific Standard Time (PST) in the Prefer: outlook.timezone header.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/me/outlook/tasks/AAMkADA1MT15rfAAA=/complete
Prefer: outlook.timezone="Pacific Standard Time"

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response. The completedDateTime and other date-related properties in the response are expressed in PST.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

{
  "value": [
    {
      "id": "AAMkADA1MT15rfAAA=",
      "createdDateTime": "2016-04-21T22:44:01.2012012-07:00",
      "lastModifiedDateTime": "2016-04-22T19:28:38.5300447-07:00",
      "changeKey": "1/KC9Vmu40G3DwB6Lgs7MAAAIW9XYQ==",
      "categories": [
      ],
      "assignedTo": null,
      "body": {
          "contentType": "text",
          "content": ""
      },
      "completedDateTime": {
          "dateTime": "2016-04-22T00:00:00.0000000",
          "timeZone": "Pacific Standard Time"
      },
      "dueDateTime": {
          "dateTime": "2016-04-25T00:00:00.0000000",
          "timeZone": "Pacific Standard Time"
      },
      "hasAttachments":false,
      "importance": "normal",
      "isReminderOn": false,
      "owner": "Administrator",
      "parentFolderId": "AQMkADA1MTIBEgAAAA==",
      "recurrence": null,
      "reminderDateTime": null,
      "sensitivity": "normal",
      "startDateTime": {
          "dateTime": "2016-04-21T00:00:00.0000000",
          "timeZone": "Pacific Standard Time"
      },
      "status": "completed",
      "subject": "Shop for dinner"
    }
  ]
}