获取 userInsightsSettings
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
获取 itemInsights 和会议时间见解的用户 可自定义的隐私设置 。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
User.Read、User.ReadWrite
委派(个人 Microsoft 帐户)
不支持。
应用程序
不支持。
HTTP 请求
GET /me/settings/itemInsights
GET /users/{userId}/settings/itemInsights
注意: 具有 或 userId userPrincipalName 的请求仅可供用户或具有 User.ReadWrite.All 权限的用户访问。 若要了解详细信息,请参阅权限 。
名称
说明
Authorization
Bearer {token}。必需。
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应 200 OK 正文中返回 响应代码和 userInsightsSettings 对象。
示例
请求
下面是请求获取用户项目见解和会议时间见解设置的示例。
GET https://graph.microsoft.com/beta/me/settings/itemInsights
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var userInsightsSettings = await graphClient.Me.Settings.ItemInsights
.Request()
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let userInsightsSettings = await client.api('/me/settings/itemInsights')
.version('beta')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/me/settings/itemInsights"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
MSGraphUserInsightsSettings *userInsightsSettings = [[MSGraphUserInsightsSettings alloc] initWithData:data error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
UserInsightsSettings userInsightsSettings = graphClient.me().settings().itemInsights()
.buildRequest()
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
result, err := graphClient.Me().Settings().ItemInsights().Get()
Import-Module Microsoft.Graph.Users
# A UPN can also be used as -UserId.
Get-MgUserSettingItemInsight -UserId $userId
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"isEnabled": true
}