Use Windows Service to Delete ChatMessage from MS Teams Channel

Woody Cox 46 Reputation points
2021-01-15T12:29:54.723+00:00

Hello,
I am currently evaluating MS Teams as a potential end-point for my company's product offering, and I have a question related to Delegated Permissions.

We would like to use a Windows Service to delete (remove) specific ChatMessages from a Teams Channel. My research and prototyping has proved that sending ChatMessages to a Teams Channel works fine from a Windows Service using Delegated Permissions (the IPublicClientApplication interface is being used for authentication), but the Windows Service is unable to delete the ChatMessages from the Teams Channel.

I am able to log in to the MS Teams Chat Client as the delegated user account and manually delete the ChatMessages, but we need an automated background process (i.e. the Windows Service under development) to perform this action.

Can you please verify my findings - that there is no way for a Windows Service using Delegated Permissions to delete ChatMessages from a Teams Channel?

Thank you,

Woody Cox

Visix, Inc.
visix.com

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,447 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,065 questions
0 comments No comments
{count} votes

Accepted answer
  1. Deva-MSFT 2,261 Reputation points Microsoft Employee
    2021-01-16T18:45:18.597+00:00

    As per documentation, i see the API will only work for Application permission and not with delegated one.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Manish-MSFT 256 Reputation points
    2021-01-18T10:21:35.047+00:00

    @Woody Cox , I think @Deva-MSFT has answered it correctly, You need application permission to update/delete chat messages.

    0 comments No comments