Microsoft Teams, Fetch ALL chat messages with MS Graph API

Brass Contributor

I need to fetch all of the users' chats (even private ones) since the Admin had already given us their consent.

How can I do that using Graph API?

We are a bit confused between the Delegated vs. Application Permissions

 

 

https://docs.microsoft.com/en-us/graph/api/chat-list?view=graph-rest-beta&tabs=http

 

 

 

I am calling the

 

 

/users/< user-id >/chats

 

 

for a user-id different from mine (I am the admin) but it returs that the call is unauthorized

Can the Admin get Delegated Permissions through setting their org-wide policies appropriately?

6 Replies

Hi @christosjubile, This question was already answered here. So we are closing this issue. 

Sorry my dear but the answer it was not sufficient enough but I had to assume it as a possible solution or a possible bug, the question remains: "Is it possible for an admin to permit a third party application to fetch all the users private chat messages?"

@christosjubilefor that API only delegated permissions can be enabled and it doesn't support application permissions. Hence you cannot get other user's chat 

Microsoft will always focus on customer’s feedback and experience, some new features would be added to the services based on customers' feedback in the future, we also recommend you give your new idea in Teams UserVoice here.

@Mamatha-MSFThow about the @Subba_Reddi_Tummuru answer? is it valid to get the message from export protected API which is proposed? https://docs.microsoft.com/en-us/microsoftteams/export-teams-content#how-to-access-teams-export-apis

@christosjubile Yes, you can get all messages using Teams Export API but, needs to have these permissions.