Unable to “List channel messages” on Azure AD Graph API Beta

偶尔善良 提交于 2019-12-08 08:50:44

问题


When I try to list channel messages I get:

[...] "code": "UnknownError", "message": "Failed to execute backend request." [...]

This error is for all teams I don't belong to.

I have this error when trying to call the API from Microsoft Flow (with HTTP GET) but also with Graph Explorer: the account I used has FULL permission but still asks to check my permission:

Failure - Status Code 403, 656ms Looks like you may not have the permissions for this call. Please modify your permissions

And the registered application has the delegated permission needed to call this endpoint regarding the documentation:

GET /teams/{id}/channels/{id}/messages

https://docs.microsoft.com/en-us/graph/api/channel-list-messages?view=graph-rest-beta

Is it a bug because of the "beta" or something I've missed?


回答1:


After searching and testing I can confirm that I was miss understanding how the delegated permission works.

The user need to have the permission to read the chat message meaning that the user need to be at least a member of the team who is concerned by the call.

I confirmed it by testing on a teams/groups where the account is not member of (result = Satus code 403) and everything is working with success after adding the account in the teams/groups

Does this mean that at the moment to be able to List channel messages from all teams in organisation we need to have a unique account member of each teams (=account used in the microsoft-graph call) ?

if anyone faced same situation this video helps to understand more easly the concept : https://www.youtube.com/watch?v=UPkHvy3eRCM



来源:https://stackoverflow.com/questions/54004221/unable-to-list-channel-messages-on-azure-ad-graph-api-beta

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