outlookTask 资源类型outlookTask resource type


Microsoft Graph 中/beta的版本下的 api 可能会发生更改。APIs under the /beta version in Microsoft Graph are subject to change. 在生产应用程序中不支持使用这些 API。Use of these APIs in production applications is not supported.

可用于跟踪工作项目的 Outlook 项目。An Outlook item that can track a work item.

你可以使用任务来跟踪开始、截止和实际完成日期及时间、其进度或状态、它是否为定期任务并且需要提醒。You can use a task to track the start, due and actual completion dates and times, its progress or status, whether it's recurring, and requires reminding.

outlookTask 资源中与日期相关的属性包括:Date-related properties in the outlookTask resource include the following:

  • completedDateTimecompletedDateTime
  • createdDateTimecreatedDateTime
  • dueDateTimedueDateTime
  • lastModifiedDateTimelastModifiedDateTime
  • reminderDateTimereminderDateTime
  • startDateTimestartDateTime

默认情况下,POST、GET、PATCH 和完成操作会在 UTC 的 REST 响应中返回与日期相关的属性。By default, the POST, GET, PATCH, and complete operations return date-related properties in their REST responses in UTC. 你可以使用 Prefer: outlook.timezone 标头将响应中的所有与日期相关的属性都表示为与 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. 以下示例在对应响应的 EST 中返回与日期相关的属性:The following example returns date-related properties in EST in the corresponding response:

Prefer: outlook.timezone="Eastern Standard Time"


方法Method 返回类型Return Type 说明Description
获取 outlookTaskGet outlookTask outlookTaskoutlookTask 获取用户邮箱中的 Outlook 任务的属性和关系。Get the properties and relationships of an Outlook task in the user's mailbox.
更新Update outlookTaskoutlookTask 更改 Outlook 任务的可写属性。Change writeable properties of an Outlook task.
删除Delete None 删除用户邮箱中的指定任务。Delete the specified task in the user's mailbox.
完成Complete outlookTask 集合outlookTask collection 完成 Outlook 任务,它将 completedDateTime 属性设置为当前日期,并将 status 属性设置为 completedComplete an Outlook task which sets the completedDateTime property to the current date, and status property to completed.
列出附件List attachments attachment 集合attachment collection 获取 Outlook 任务的所有附件。Get all attachments on an Outlook task.
添加附件Add attachment 附件attachment 向任务添加作为附件的文件、项目(消息、事件或联系人)或文件链接。Add a file, item (message, event or contact), or link to a file as an attachment to a task.
扩展属性Extended properties
创建单值扩展属性Create single-value extended property outlookTaskoutlookTask 在新建或现有 Outlook 任务中创建一个或多个单值扩展属性。Create one or more single-value extended properties in a new or existing Outlook task.
获取具有单值扩展属性的任务Get task with single-value extended property outlookTaskoutlookTask 通过使用 $expand$filter 获取包含单值扩展属性的 Outlook 任务。Get Outlook tasks that contain a single-value extended property by using $expand or $filter.
创建多值扩展属性Create multi-value extended property outlookTaskoutlookTask 在新建或现有的 Outlook 任务中创建一个或多个多值扩展属性。Create one or more multi-value extended properties in a new or existing Outlook task.
获取具有多值扩展属性的任务Get task with multi-value extended property outlookTaskoutlookTask 使用 $expand 获取包含一个多值扩展属性的 Outlook 任务。Get an Outlook task that contains a multi-value extended property by using $expand.


属性Property 类型Type 说明Description
assignedToassignedTo StringString 已为其分配任务的人员姓名。The name of the person who has been assigned the task.
正文body itemBodyitemBody 通常包含有关任务的信息的任务正文。The task body that typically contains information about the task. 请注意,仅支持 HTML 类型。Note that only HTML type is supported.
类别categories String 集合String collection 与任务关联的类别。The categories associated with the task. 每个类别对应于用户定义的 outlookCategorydisplayName 属性。Each category corresponds to the displayName property of an outlookCategory that the user has defined.
changeKeychangeKey StringString 任务的版本。The version of the task.
completedDateTimecompletedDateTime dateTimeTimeZonedateTimeTimeZone 在指定时区内完成任务的日期。The date in the specified time zone that the task was finished.
createdDateTimecreatedDateTime DateTimeOffsetDateTimeOffset 任务的创建日期和时间。The date and time when the task was created. 默认情况下,它采用 UTC 格式。By default, it is in UTC. 你可以在请求标头中提供自定义时区。You can provide a custom time zone in the request header. 属性值使用 ISO 8601 格式。The property value uses ISO 8601 format. 例如,2014 年 1 月 1 日午夜 UTC 如下所示:'2014-01-01T00:00:00Z'For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'.
dueDateTimedueDateTime dateTimeTimeZonedateTimeTimeZone 要在指定时区内完成任务的日期。The date in the specified time zone that the task is to be finished.
hasAttachmentshasAttachments BooleanBoolean 如果任务包含附件,则设置为 true。Set to true if the task has attachments.
idid StringString 任务的唯一标识符。Unique identifier for the certificate. 默认情况下, 在将项目从一个容器 (如文件夹或日历) 移动到另一个容器时, 此值会发生更改。By default, this value changes when the item is moved from one container (such as a folder or calendar) to another. 若要更改此行为, 请Prefer: IdType="ImmutableId"使用标头。To change this behavior, use the Prefer: IdType="ImmutableId" header. 有关详细信息, 请参阅获取 Outlook 资源的不可变标识符See Get immutable identifiers for Outlook resources for more information. 只读。Read-only.
importanceimportance stringstring 事件的重要性。The importance of the event. 可取值为:lownormalhighPossible values are: low, normal, high.
isReminderOnisReminderOn BooleanBoolean 如果设置警报以提醒用户有任务,则设置为 true。Set to true if an alert is set to remind the user of the task.
lastModifiedDateTimelastModifiedDateTime DateTimeOffsetDateTimeOffset 上次修改任务的日期和时间。The date and time when the task was last modified. 默认情况下,它采用 UTC 格式。By default, it is in UTC. 你可以在请求标头中提供自定义时区。You can provide a custom time zone in the request header. 属性值使用 ISO 8601 格式,并始终处于 UTC 时间。The property value uses ISO 8601 format and is always in UTC time. 例如,2014 年 1 月 1 日午夜 UTC 如下所示:'2014-01-01T00:00:00Z'For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'.
所有者owner StringString 任务创建者的姓名。The name of the person who created the task.
parentFolderIdparentFolderId StringString 任务的父文件夹的唯一标识符。The unique identifier for the task's parent folder.
定期recurrence patternedRecurrencepatternedRecurrence 任务的定期模式。The recurrence pattern for the task.
reminderDateTimereminderDateTime dateTimeTimeZonedateTimeTimeZone 提醒警报发出任务发生提醒的日期和时间。The date and time for a reminder alert of the task to occur.
敏感度sensitivity stringstring 指示任务的隐私级别。Indicates the level of privacy for the task. 可取值为:normalpersonalprivateconfidentialPossible values are: normal, personal, private, confidential.
startDateTimestartDateTime dateTimeTimeZonedateTimeTimeZone 要在指定时区内开始执行任务的日期。The date in the specified time zone when the task is to begin.
状态status stringstring 指示任务的状态或进度。Indicates the state or progress of the task. 可取值为:notStartedinProgresscompletedwaitingOnOthersdeferredPossible values are: notStarted, inProgress, completed, waitingOnOthers, deferred.
主题subject StringString 任务的简要说明或标题。A brief description or title of the task.


关系Relationship 类型Type 说明Description
attachmentsattachments attachment 集合attachment collection 任务的 fileAttachmentitemAttachmentreferenceAttachment 附件的集合。The collection of fileAttachment, itemAttachment, and referenceAttachment attachments for the task. 只读。Read-only. 可为 Null。Nullable.
multiValueExtendedPropertiesmultiValueExtendedProperties multiValueLegacyExtendedProperty 集合multiValueLegacyExtendedProperty collection 为任务定义的多值扩展属性的集合。The collection of multi-value extended properties defined for the task. 只读。Read-only. 可为 Null。Nullable.
singleValueExtendedPropertiessingleValueExtendedProperties singleValueLegacyExtendedProperty 集合singleValueLegacyExtendedProperty collection 为任务定义的单值扩展属性的集合。The collection of single-value extended properties defined for the task. 只读。Read-only. 可为 Null。Nullable.

JSON 表示形式JSON representation

下面是资源的 JSON 表示形式。Here is a JSON representation of the resource.

  "assignedTo": "String",
  "body": {"@odata.type": "microsoft.graph.itemBody"},
  "categories": ["String"],
  "changeKey": "String",
  "completedDateTime": {"@odata.type": "microsoft.graph.dateTimeTimeZone"},
  "createdDateTime": "String (timestamp)",
  "dueDateTime": {"@odata.type": "microsoft.graph.dateTimeTimeZone"},
  "hasAttachments": true,
  "id": "String (identifier)",
  "importance": "string",
  "isReminderOn": true,
  "lastModifiedDateTime": "String (timestamp)",
  "owner": "String",
  "parentFolderId": "String",
  "recurrence": {"@odata.type": "microsoft.graph.patternedRecurrence"},
  "reminderDateTime": {"@odata.type": "microsoft.graph.dateTimeTimeZone"},
  "sensitivity": "string",
  "startDateTime": {"@odata.type": "microsoft.graph.dateTimeTimeZone"},
  "status": "string",
  "subject": "String"