http - Microsoft Graph 列表活动统计
问题描述
我关注网页(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)作为图像显示 到 List activityStatistics ,但总是得到以下信息。
{
"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 以检查我是否拥有像图像一样的许可证
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users('5eed83b1-2949-4c9f-b42a-ee9055dfb4fd')/analytics/settings",
"hasLicense": true,
"hasOptedOut": false,
"hasGraphMailbox": true
}
我该如何解决这个问题?非常感谢。
解决方案
根据本文档,要让分析 API 为用户返回结果,当前用户分析设置必须显示有效的 MyAnalytics 许可证,选择使用 MyAnalytics,并具有启用图形的云托管邮箱。
签名用户 (/me) 应具有以下响应 GET /me/analytics/settings { "hasGraphMailbox": true, "hasLicense": true, "hasOptedOut": false }
然后 Analytics API 将返回结果。如果用户没有许可证,您可以通过PowerShell分配许可证
用户还应该分配有“Microsoft MyAnalytics(Full)”许可证,如下图所示。要分配许可证,您可以导航到 portal.office.com。
推荐阅读
- django - 在 Postgres 中实际发生更新之前,Django ORM 更新命令会返回吗?
- windows - 如何将 Windows 目录输出发送到 git add
- javascript - 如何从高图表导出中删除“数据表”选项
- android - iOS 和 Android 的 Google Places SDK 使用限制
- python - RPi 和 Arduino 之间通过 UART 进行通信
- react-native - Metro Bundler 每次在新窗口中运行
- ssl - How to disable ssl check in react native XMLHttpRequest API or in Fetch Api?
- python - 删除所有匹配通配符的最新两个文件
- android - 设置“adjustPan”软输入模式时,ConstraintLayout 内的内容不滚动
- python - 如何减慢pygame中的动画?