Same issue here
Sending messages in Teams from a background service
Hi everyone!
I'm new to MS Graph and Teams, and I'm trying to create a background application that would send a reply to a specific post in a specific channel in MS Teams (or send a message to a specific group chat) based on events.
I set app the application in Azure, obtained a token, got consent for API calls, and was able to use it to create a chat without a problem. However, when I try using this endpoint or that one I receive an error: "Message POST is allowed in application-only context only for import purposes". Reading through the documentation, it appears that we can't use this API call at all without a special migration mode which can't be enabled for every message.
On the other hand, API docs suggest there is a "Delegated access" type, however, it looks inapplicable to a standalone background service which is supposed to be running without any user interactions.
Overall, I'm completely blocked here by Graph API restrictions, and looks like the only way Microsoft is pushing us is to create posts in channels but not messages of any type.
Does someone have a success story? How do you implement notifications in teams?