I'm trying to find out if there's a way to send messages to a private channel in Microsoft Teams using PowerShell or the Microsoft Graph API. I've seen recommendations to use Power Automate, but it looks like sending messages to private channels isn't supported. I found some documentation on Microsoft Graph, but I'm unclear about whether I can use it for this purpose. I believe it requires delegated permissions rather than application permissions. Can anyone provide step-by-step guidance on how this could be done, if it's even possible? Thanks in advance!
1 Answer
Unfortunately, you can't send messages directly to a private Teams channel using the Microsoft Graph API. One workaround could be to set up a Webhook URL for the private channel, which would allow you to send messages through a simple HTTP POST request. Also, just a heads up, you can't use Application permissions for this; only delegated permissions work. In case you're trying to utilize Power Automate, keep in mind that it's not going to support sending messages to private channels either since Microsoft will be retiring the Teams Workflow app soon.
So if I'm getting this right, I can't use a delegated user to send messages directly in a private channel? Does that mean my Plan B of sending messages via a delegated user won't work with Power Automate or Graph as well? I've seen some success in manually logging into Graph Explorer, but can I replicate that with a POST/CURL call?