为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型
最低特权权限
更高特权权限
委派(工作或学校帐户)
Mail.ReadBasic
Mail.ReadWrite、Mail.Read
委派(个人 Microsoft 帐户)
Mail.ReadBasic
Mail.ReadWrite、Mail.Read
应用程序
Mail.ReadBasic.All
Mail.ReadWrite、Mail.Read
HTTP 请求
若要获取指定文件夹的所有子文件夹(隐藏文件夹除外),请执行以下操作:
GET /me/mailFolders/{id}/childFolders
GET /users/{id | userPrincipalName}/mailFolders/{id}/childFolders
若要在答复中包括隐藏的子文件夹,请执行以下操作:
GET /me/mailFolders/{id}/childFolders?includeHiddenFolders=true
GET /users/{id | userPrincipalName}/mailFolders/{id}/childFolders?includeHiddenFolders=true
GET https://graph.microsoft.com/beta/me/mailFolders/AAMkAGVmMDEzM/childFolders
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.MailFolders["{mailFolder-id}"].ChildFolders.GetAsync();
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MailFolderCollectionResponse result = graphClient.me().mailFolders().byMailFolderId("{mailFolder-id}").childFolders().get();
Import-Module Microsoft.Graph.Beta.Mail
# A UPN can also be used as -UserId.
Get-MgBetaUserMailFolderChildFolder -UserId $userId -MailFolderId $mailFolderId
GET https://graph.microsoft.com/beta/me/mailFolders/searchfolders/childFolders
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.MailFolders["{mailFolder-id}"].ChildFolders.GetAsync();
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MailFolderCollectionResponse result = graphClient.me().mailFolders().byMailFolderId("{mailFolder-id}").childFolders().get();
Import-Module Microsoft.Graph.Beta.Mail
# A UPN can also be used as -UserId.
Get-MgBetaUserMailFolderChildFolder -UserId $userId -MailFolderId $mailFolderId
GET https://graph.microsoft.com/beta/me/mailFolders/AAMkAGVmMDEzM/childFolders?includeHiddenFolders=true
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.MailFolders["{mailFolder-id}"].ChildFolders.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.IncludeHiddenFolders = "true";
});
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta users mail-folders child-folders list --user-id {user-id} --mail-folder-id {mailFolder-id} --include-hidden-folders "true"
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MailFolderCollectionResponse result = graphClient.me().mailFolders().byMailFolderId("{mailFolder-id}").childFolders().get(requestConfiguration -> {
requestConfiguration.queryParameters.includeHiddenFolders = "true";
});
Import-Module Microsoft.Graph.Beta.Mail
# A UPN can also be used as -UserId.
Get-MgBetaUserMailFolderChildFolder -UserId $userId -MailFolderId $mailFolderId -Includehiddenfolders true