【问题标题】:Microsoft Graph List activityStatisticsMicrosoft Graph 列表活动统计
【发布时间】:2021-03-02 00:13:02
【问题描述】:

我关注网页(https://docs.microsoft.com/en-us/graph/api/activitystatistics-list?view=graph-rest-beta&tabs=http) 并使用 MS Graph Explorer (https://developer.microsoft.com/en-us/graph/graph-explorer/preview) 作为the image show 列出活动统计,但总是得到以下信息。

{
"error": {
"code": "UnknownError",
"message": "{"Code":"Forbidden","Message":"Access to the requested resource is forbidden.","Target":"ReadUserAnalyticsV2","Details":[{"Code":"PolicyNotSatisfied","Message":"The following authorization requirements are not satisfied: UserRequireAdvancedMyALicense."}]}",
"innerError": {
"request-id": "0bf68858-17f4-498c-bb2b-c2c185e51e78",
"date": "2020-04-08T18:22:22"
}
}
}

我已经尝试使用许可获取 https://graph.microsoft.com/beta/me/analytics/settings 检查我是否有许可证like the images

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('5eed83b1-2949-4c9f-b42a-ee9055dfb4fd')/analytics/settings",
    "hasLicense": true,
    "hasOptedOut": false,
    "hasGraphMailbox": true
}

我该如何解决这个问题?非常感谢。

【问题讨论】:

  • 请发布您的代码,以便我们查看
  • 谢谢,我已经用执行图片修改了我的帖子。

标签: http microsoft-graph-api microsoft-teams office365api microsoft-live-meeting


【解决方案1】:

根据此document,要让分析 API 为用户返回结果,当前用户分析设置必须显示有效的 MyAnalytics 许可证,选择使用 MyAnalytics,并拥有一个云托管邮箱,该邮箱是已启用。

签名用户 (/me) 应该对 GET /me/analytics/settings 有以下响应 { “hasGraphMailbox”:是的, “hasLicense”:是的, “hasOptedOut”:假 }

然后 Analytics API 将返回结果。 如果用户没有license,可以通过PowerShell分配license

用户还应分配“Microsoft MyAnalytics(Full)”许可证,如下图所示。要分配许可证,您可以导航到 portal.office.com。

【讨论】:

  • 我检查了 GET /me/analytics/settings ,我有许可证,下面列出 { "@odata.context": "graph.microsoft.com/beta/…", "hasLicense": true, "hasOptedOut" :假,“hasGraphMailbox”:真}
  • 您可以登录myanalytics.microsoft.com并确认您是否可以看到用户的活动数据吗?
  • 我已经用额外的许可要求更新了答案(Microsoft MyAnalytics(Full))。分配许可证后,需要几分钟才能反映更改。我附上了屏幕截图供您参考。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-16
  • 1970-01-01
  • 2020-04-04
相关资源
最近更新 更多