mailFolder 资源类型mailFolder resource type

用户邮箱中的邮箱文件夹,例如收件箱和草稿箱。A mail folder in a user's mailbox, such as Inbox and Drafts. 邮箱文件夹可以包含邮件、其他 Outlook 项和子邮件文件夹。Mail folders can contain messages, other Outlook items, and child mail folders.

该资源支持通过提供 delta 函数使用增量查询跟踪增量添加、删除和更新。This resource supports using delta query to track incremental additions, deletions, and updates, by providing a delta function.

已知文件夹名称Well-known folder names

Outlook 默认情况下会为用户创建某些文件夹。Outlook creates certain folders for users by default. 为方便起见,可以在访问这些文件夹时使用已知的文件夹名称来替代使用相应的文件夹 id 值。Instead of using the corresponding folder id value, for convenience, you can use the well-known folder names from the table below when accessing these folders. 例如,你可以使用其已知名称和以下查询来获取“草稿”文件夹。For example, you can get the Drafts folder using its well-known name with the following query.

GET /me/mailFolders/drafts

无论用户邮箱的区域设置如何,已知名称都可以工作,因此无论命名方式如何,上述查询都将始终返回用户的“草稿”文件夹。Well-known names work regardless of the locale of the user's mailbox, so the above query will always return the user's Drafts folder regardless of how it is named.

已知文件夹名称Well-known folder name 说明Description
archivearchive 在支持它的 Outlook 客户端中使用 One_Click 存档功能时,将发送存档文件夹邮件。The archive folder messages are sent to when using the One_Click Archive feature in Outlook clients that support it. 注意: 这与 Exchange Online 的存档邮箱功能并不相同。Note: this is not the same as the Archive Mailbox feature of Exchange online.
clutterclutter 使用待筛选邮件功能时,待筛选文件夹低优先级邮件将被移动到这里。The clutter folder low-priority messages are moved to when using the Clutter feature.
conflictsconflicts 包含邮箱中冲突项的文件夹。The folder that contains conflicting items in the mailbox.
conversationhistoryconversationhistory Skype 保存 IM 对话的文件夹(如果 Skype 配置为这样做)。The folder where Skype saves IM conversations (if Skype is configured to do so).
deleteditemsdeleteditems 文件夹项被删除时,将被移动到这里。The folder items are moved to when they are deleted.
draftsdrafts 包含未发送邮件的文件夹。The folder that contains unsent messages.
inboxinbox 收件箱文件夹。The inbox folder.
junkemailjunkemail “垃圾邮件”文件夹。The junk email folder.
localfailureslocalfailures 包含本地客户端上存在但无法上载到服务器的项的文件夹。The folder that contains items that exist on the local client but could not be uploaded to the server.
msgfolderrootmsgfolderroot “最上层的信息文件”文件夹。The "Top of Information Store" folder. 此文件夹是在普通邮件客户端(如收件箱)中显示的文件夹的父文件夹。This folder is the parent folder for folders that are displayed in normal mail clients, such as the inbox.
outboxoutbox “发件箱”文件夹。The outbox folder.
recoverableitemsdeletionsrecoverableitemsdeletions 包含软删除项的文件夹:从“已删除邮件”文件夹中删除,或者在 Outlook 中按 shift+delete 删除。The folder that contains soft-deleted items: deleted either from the Deleted Items folder, or by pressing shift+delete in Outlook. 此文件夹在任何 Outlook 电子邮件客户端中都不可见,但最终用户可以通过 Outlook 中的“从服务器恢复已删除邮件”功能或 Web 上的 Outlook 与其进行交互。This folder is not visible in any Outlook email client, but end users can interact with it through the Recover Deleted Items from Server feature in Outlook or Outlook on the web.
scheduledscheduled 包含计划使用 Outlook for iOS 中的“计划”功能重新出现在收件箱中的邮件的文件夹。The folder that contains messages that are scheduled to reappear in the inbox using the Schedule feature in Outlook for iOS.
searchfolderssearchfolders 用户邮箱中定义的所有搜索文件夹的父文件夹。The parent folder for all search folders defined in the user's mailbox.
sentitemssentitems 已发送项的文件夹。The sent items folder.
serverfailuresserverfailures 包含服务器上存在但无法同步到本地客户端的项的文件夹。The folder that contains items that exist on the server but could not be synchronized to the local client.
syncissuessyncissues 包含 Outlook 创建的同步日志的文件夹。The folder that contains synchronization logs created by Outlook.

方法Methods

方法Method 返回类型Return Type 说明Description
获取 mailFolderGet mailFolder mailFoldermailFolder 读取 mailFolder 对象的属性和关系。Read properties and relationships of mailFolder object.
创建 MailFolderCreate MailFolder MailFolderMailFolder 通过发布到 childFolder 集合,在当前 mailFolder 下新建 mailFolder。Create a new mailFolder under the current one by posting to the childFolders collection.
列出 childFolderList childFolders MailFolder 集合MailFolder collection 获取指定文件夹下的文件夹集合。你可以使用 .../me/MailFolders 快捷方式获取顶级文件夹集合并导航到其他文件夹。Get the folder collection under the specified folder. You can use the .../me/MailFolders shortcut to get the top-level folder collection and navigate to another folder.
创建邮件Create Message 邮件Message 通过发布到邮件集合,在当前 mailFolder 中新建邮件。Create a new message in the current mailFolder by posting to the messages collection.
列出邮件List messages 邮件 集合Message collection 获取已登录用户邮箱中的所有邮件或邮箱的指定文件夹中的邮件。Get all the messages in the signed-in user's mailbox, or those messages in a specified folder in the mailbox.
更新Update mailFoldermailFolder 更新指定的 mailFolder 对象。Update the specified mailFolder object.
删除Delete None 删除指定的 mailFolder 对象。Delete the specified mailFolder object.
复制copy MailFolderMailFolder 将 mailfolder 及其内容复制到其他 mailfolder。Copy a mailFolder and its contents to another mailFolder.
deltadelta mailFolder 集合mailFolder collection 获取用户邮箱中已添加、删除或移除的邮件文件夹集。Get a set of mail folders that have been added, deleted, or removed from the user's mailbox.
移动move MailFolderMailFolder 将 mailFolder 及其内容移动到其他 mailFolder。Move a mailFolder and its contents to another mailFolder.
扩展属性Extended properties
创建单值扩展属性Create single-value extended property mailFoldermailFolder 在新建或现有的 mailFolder 中创建一个或多个单值扩展属性。Create one or more single-value extended properties in a new or existing mailFolder.
获取具有单值扩展属性的 mailFolderGet mailFolder with single-value extended property mailFoldermailFolder 通过使用 $expand$filter 获取包含一个单值扩展属性的 mailFolder。Get mailFolders that contain a single-value extended property by using $expand or $filter.
创建多值扩展属性Create multi-value extended property mailFoldermailFolder 在新建或现有的 mailFolder 中创建一个或多个多值扩展属性。Create one or more multi-value extended properties in a new or existing mailFolder.
获取具有多值扩展属性的 mailFolderGet mailFolder with multi-value extended property mailFoldermailFolder 使用 $expand 获取包含一个多值扩展属性的 mailFolder。Get a mailFolder that contains a multi-value extended property by using $expand.

属性Properties

属性Property 类型Type 说明Description
childFolderCountchildFolderCount Int32Int32 当前 mailFolder 中的直接子 mailFolder 数量。The number of immediate child mailFolders in the current mailFolder.
displayNamedisplayName StringString mailFolder 的显示名称。The mailFolder's display name.
idid StringString MailFolder 的唯一标识符。The mailFolder's unique identifier.
parentFolderIdparentFolderId StringString MailFolder 的父 mailFolder 的唯一标识符。The unique identifier for the mailFolder's parent mailFolder.
totalItemCounttotalItemCount Int32Int32 邮箱中项的数量The number of items in the mailFolder.
unreadItemCountunreadItemCount Int32Int32 mailFolder 中标记为未读的项的数量。The number of items in the mailFolder marked as unread.

有效的访问项计数Access item counts efficiently

使用文件夹的 TotalItemCountUnreadItemCount 的属性可以方便地计算在文件夹中读取的项数。The TotalItemCount and UnreadItemCount properties of a folder allow you to conveniently compute the number of read items in the folder. 使你避免进行可产生重大延迟的查询,如下所示:They let you avoid queries like the following that can incur significant latency:

https://outlook.office.com/api/v1.0/me/folders/inbox/messages?$count=true&$filter=isread%20eq%20false

Outlook 中的邮件文件夹可包含多个类型的项,例如,收件箱可以包含不同于邮件项的会议请求项。Mail folders in Outlook can contain more than one type of items, for example, the Inbox can contain meeting request items which are distinct from mail items. TotalItemCountUnreadItemCount包括邮件文件夹中的项,无论其项类型如何。TotalItemCount and UnreadItemCount include items in a mail folder irrespective of their item types.

关系Relationships

关系Relationship 类型Type 说明Description
childFolderschildFolders MailFolder 集合MailFolder collection mailFolder 中的子文件夹集合。The collection of child folders in the mailFolder.
messageRulesmessageRules messageRule 集合messageRule collection 适用于用户“收件箱”文件夹的规则集合。The collection of rules that apply to the user's Inbox folder.
messagesmessages 邮件 集合Message collection mailFolder 中的邮件集合。The collection of messages in the mailFolder.
multiValueExtendedPropertiesmultiValueExtendedProperties multiValueLegacyExtendedProperty 集合multiValueLegacyExtendedProperty collection 为 mailFolder 定义的多值扩展属性的集合。只读。可为 NULL。The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable.
singleValueExtendedPropertiessingleValueExtendedProperties singleValueLegacyExtendedProperty collectionsingleValueLegacyExtendedProperty collection 为 mailFolder 定义的单值扩展属性的集合。只读。可为 NULL。The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable.

JSON 表示形式JSON representation

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

{
  "childFolderCount": 1024,
  "displayName": "string",
  "id": "string (identifier)",
  "parentFolderId": "string",
  "totalItemCount": 1024,
  "unreadItemCount": 1024,
  "childFolders": [ { "@odata.type": "microsoft.graph.mailFolder" } ],
  "messageRules": [ { "@odata.type": "microsoft.graph.messageRule" } ],
  "messages": [ { "@odata.type": "microsoft.graph.message" } ],
  "multiValueExtendedProperties": [ { "@odata.type": "microsoft.graph.multiValueLegacyExtendedProperty" }],
  "singleValueExtendedProperties": [ { "@odata.type": "microsoft.graph.singleValueLegacyExtendedProperty" }]
}

另请参阅See also