Skip to content

Latest commit

 

History

History
204 lines (160 loc) · 8.97 KB

File metadata and controls

204 lines (160 loc) · 8.97 KB
title Update outlooktask
description Change writable properties of an Outlook task.
author mashriv
ms.localizationpriority medium
ms.subservice outlook
doc_type apiPageType
ms.date 04/04/2024

Update outlooktask (deprecated)

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

[!INCLUDE outlooktask-deprecate-allup]

Change writable properties of an Outlook task.

The completedDateTime property can be set by the complete action, or explicitly by a PATCH operation. If you use PATCH to set completedDateTime, make sure you set status to completed as well.

By default, this operation (and the POST, GET, and complete 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

PATCH /me/outlook/tasks/{id}
PATCH /users/{id|userPrincipalName}/outlook/tasks/{id}

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

In the request body, supply the values for relevant fields that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values. For best performance you shouldn't include existing values that haven't changed.

Property Type Description
body itemBody The task body that typically contains information about the task. Note that only HTML type is supported.
categories String collection The categories associated with the task.
changeKey String The version of the task.
completedDateTime dateTimeTimeZone The date in the specified time zone that the task was finished.
createdDateTime DateTimeOffset The date and time when the task was created. By default, it is in UTC. You can provide a custom time zone in the request header. The property value uses ISO 8601 format. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
dueDateTime dateTimeTimeZone The date in the specified time zone that the task is to be finished.
hasAttachments Boolean Set to true if the task has attachments.
importance string The importance of the event. The possible values are: low, normal, high.
isReminderOn Boolean Set to true if an alert is set to remind the user of the task.
lastModifiedDateTime DateTimeOffset The date and time when the task was last modified. By default, it is in UTC. You can provide a custom time zone in the request header. The property value uses ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
owner String The name of the person who created the task.
parentFolderId String The unique identifier for the task's parent folder.
recurrence patternedRecurrence The recurrence pattern for the task.
reminderDateTime dateTimeTimeZone The date and time for a reminder alert of the task to occur.
sensitivity string Indicates the level of privacy for the task. The possible values are: normal, personal, private, confidential.
startDateTime dateTimeTimeZone The date in the specified time zone when the task is to begin.
status string Indicates the state or progress of the task. The possible values are: notStarted, inProgress, completed, waitingOnOthers, deferred.
subject String A brief description or title of the task.

Response

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

Example

Request

The following example modifies the dueDateTime property and uses the Prefer: outlook.timezone header to specify expressing the date-related properties in the response in Eastern Standard Time (EST).

PATCH https://graph.microsoft.com/beta/me/outlook/tasks/AAMkADA1MTHgwAAA=
Prefer: outlook.timezone="Eastern Standard Time"
Content-type: application/json

{
  "dueDateTime":  {
      "dateTime": "2016-05-06T16:00:00",
      "timeZone": "Eastern 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. Note: The response object shown here might be shortened for readability.

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

{
    "id": "AAMkADA1MTHgwAAA=",
    "createdDateTime": "2016-04-22T18:19:18.9526004-04:00",
    "lastModifiedDateTime": "2016-04-22T18:38:20.5541528-04:00",
    "changeKey": "1/KC9Vmu40G3DwB6Lgs7MAAAIW9XXg==",
    "categories": [
    ],
    "assignedTo": null,
    "body": {
        "contentType": "text",
        "content": ""
    },
    "completedDateTime": null,
    "dueDateTime": {
        "dateTime": "2016-05-06T00:00:00.0000000",
        "timeZone": "Eastern Standard Time"
    },
    "hasAttachments":false,
    "importance": "normal",
    "isReminderOn": false,
    "owner": "Administrator",
    "parentFolderId": "AQMkADA1MTIBEgAAAA==",
    "recurrence": null,
    "reminderDateTime": null,
    "sensitivity": "normal",
    "startDateTime": {
        "dateTime": "2016-05-03T00:00:00.0000000",
        "timeZone": "Eastern Standard Time"
    },
    "status": "notStarted",
    "subject": "Shop for children's weekend"

}