Microsoft Graph: how to get Data from users of an organisation through web app?

扶醉桌前 提交于 2019-12-11 09:14:31

问题


I am building a web application that needs to access the tasks from Outlook tasks of some the users of my organisation. I know this functionality is fairly new to Microsoft Graph according to this:

https://developer.microsoft.com/en-us/graph/docs/concepts/changelog#outlook-tasks

When I use Graph Explorer I can get all my tasks with this call:

https://graph.microsoft.com/beta/me/outlook/tasks

But my tasks or the current user's tasks are not what I need. I need to have access to the tasks list of all the users of Outlook task in my organisation regardless of who is currently connected in the app. I know i can use something like this to get tasks from a spcific user:

GET /users/{id|userPrincipalName}/outlook/tasks

But i always recevie the follwing response:

{ "error": { "code": "ErrorAccessDenied", "message": "Access is denied. Check credentials and try again.", "innerError": { "request-id": "5831bd5b-8fd1-4f77-b49b-c976ddffab3f", "date": "2017-07-18T15:42:49" } } }

I have grant every administrator's permissions but I still receive the same response. Did I skipped importants steps? If so, what are those steps? Can I test this functionality in Graph Explorer or I must test it in my app?


回答1:


At the moment, you can only access Outlook Tasks using delegated permissions (i.e. on behalf of the current user). You can reach outside their own tasks using the Tasks.Read.Shared scope but again, this only provide additional access to Outlook Tasks that were shared with the current user.

What you're looking for here would be Tasks.Read.All or Tasks.ReadWrite.All permissions. These would fall under Application Permissions and require Administrative Consent. At the moment this functionality isn't available, although I'm sure it is being considered. I would certainly recommend posting this suggestion in the User Voice.



来源:https://stackoverflow.com/questions/45171844/microsoft-graph-how-to-get-data-from-users-of-an-organisation-through-web-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!