Shantha Kumar T
How to lists different Chat information from Tenant
Microsoft Graph API extending its features across the Microsoft 365 Cloud. One of the features is MS Teams. In this blog, we are going to see how to get the different chat information for different scenarios.
To view the list of chats, we must consent with any one of the below Microsoft Graph API permissions,
- Chat.ReadBasic
- Chat.Read
- Chat.ReadWrite
To get all the chats from the tenant,
Method: Get
https://graph.microsoft.com/beta/chats
Below is the sample screenshot is taken from Microsoft Graph Explorer and this returns all the chats with basic details.
To get all the chats for the current user,
Method: get
https://graph.microsoft.com/beta/me/chats
To get all the chats for the specified user,
Method: Get
https://graph.microsoft.com/beta/users/<User id>/chats
To get only meeting chats for the specified user
Method: Get
https://graph.microsoft.com/beta/users/<User id>/chats?$filter=chatType eq ‘meeting’
To get only the One on One chat for the specified user,
Method: Get
https://graph.microsoft.com/beta/users/<User id>/chats?$filter=chatType eq ‘OneonOne’
To get only the group chats for the specified user
Method: Get
https://graph.microsoft.com/beta/users/<User id>/chats?$filter=chatType eq ‘group’
Does this require special license?
Also, what are you using for User ID? I have tried UPN, ID (from user profile object) and email and none are a valid endpoint
let me give you some context.
I have just managed to get this to work in Graph explorer. After reading it properly at last!
But I am trying to get this to work from a Power Automate Flow using connector “send an Http Request” connector
Oh – can’t attach screenshot
here is error message
“URI path is not a valid Graph endpoint, path is neither absolute nor relative or resource/object is not supported for this connector. Resources: me,users Objects: messages,mailFolders,events,calendar,calendars,outlook,inferenceClassification. Uri: https://graph.microsoft.com/beta/me/chats“