Pages Menu
TwitterRssFacebook

Posted by on Dec 11, 2020 in Development, Microsoft Teams | 0 comments

New in Microsoft Graph: API calls to get EVERYTHING a user sent in Chat, All Chats in Channels, and support for Apps in Chat

New in Microsoft Graph: API calls to get EVERYTHING a user sent in Chat, All Chats in Channels, and support for Apps in Chat

It’s been a busy week for adding new Microsoft Teams functionality to Microsoft Graph, and also for graduating beta functionality to 1.0. Here’s a roundup of what’s new – including new functionality for managing apps, and new ways to get ALL chat data about a user or a channel.

Promoted to 1.0

These calls are all about programmatically working with apps in Microsoft Teams. Some of these calls were in beta before and some look to have jumped straight to 1.0 (but I’m not certain of that).

There is support for adding and removing, listing and upgrading. With these APIs, this should really improve the experience of users in enterprises because it will enable admins to grant permission to apps to install themselves as needed, rather than requiring users to manually choose them from the Store.

What is really good to see is that the permission scopes of these calls are both granular and specific, such as in this call to retrieve information about an app installed in a team:

The full list of new API calls in 1.0 are:

New to beta: Apps & Tabs in Chat

There are new APIs to support both apps & tabs in chat. It’s good to see these added to the API lineup and bringing the same functionality to apps in chat, as are in channels:

List apps in chat
Get installed apps in chat
Add app to chat
Uninstall app from chat
Upgrade installed app in chat

List tabs in chat
Get tab in chat
Add tab to chat
Remove tab from chat
Update tab in chat

New to beta: Get All Messages API Calls

There are two new API calls in beta now, which will be of interest to anyone trying to parse all information about a user’s chat behaviour, or all the conversations happening in a channel.

Get All Chat Messages

This call gets all messages from all chats that a user is a participant in, including one-on-one chats, group chats, and meeting chats.

It requires Chat.Read.All or higher, and is a Protected API call.

The API call supports using oData to filter on the lastModifiedTime being between two values.

Usage:

GET /users/{id}/chats/getAllMessages

More: Get all chat messages

Get All Channel Messages

This call gets all messages across all channels in a team including text, audio, and video conversations.

It requires the ChannelMessage.Read.All permissions and is a Protected API call.

There are currently no OData parameters you can use with this call, meaning it will return all messages in all channels in the team.

Usage:

GET /teams/{id}/channels/getAllMessages

More: Get messages across all channels

Written by Tom Morgan

Tom is a Microsoft Teams Platform developer and Microsoft MVP who has been blogging for over a decade. Find out more.
Tom is currently writing a book: Building and Developing Apps & Bots for Microsoft Teams. Register your interest today and be the first to know when it's ready to read.

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.