Programmatically create inbound webhook to Teams Channel?
I want my application to be able to post messages/notifications into external Teams channels.
So far I've only found the manual way to do this- making the user generate an incoming webhook URL through their personal Teams app. They would then have to submit the signed URL to our website/application so we can use it for future notifications
This is a poor and confusing user experience.
I know slack allows programmatic webhook generation based on documentation here:
https://api.slack.com/authentication/oauth-v2
https://api.slack.com/legacy/oauth#flow
Is there something I'm missing in the Microsoft Graph API docs? Maybe if I have a way for the user to sign in and grant temporary credentials/a bearer token to our website/application, I could then use the temporary permissions to call an API to create this same webhook and save it for future use? Or have the granted permissions stay permanent, and use a Graph API call to post messages in designated channels moving forward?
As of last year according to this stack overflow reply, programmatic creation of webhooks doesn't seem to be supported: https://stackoverflow.com/questions/76718712/is-there-a-way-to-have-zero-touch-install-for-ms-teams-connectors-into-channel
Is it possible to add this as a thing to work on, given that it would make Teams integrations so much smoother?
Other options I looked into:
- A notification bot: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/interactive-notification-bot-in-teams?tabs=ts1%2Cts2%2Cts3%2Cts4%2Cjsts%2Cts5
- Downside is that user has to manually install the bot into their teams account, and then sign in to our application from there as well
- Authentication and authorization are also not provided out of the box
- We would have to maintain the code for a new repo based on this tutorial. And it seems we'd need to have something hosted on Azure functions or similar, to handle http requests
- Connectors: https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-creating
- This seems to be a better way to pre-configure the incoming web hook set up.
- But I also see here that connectors are being retired in favor of workflows: https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/#:~:text=Why%20are%20we%20retiring%20Office,%2C%20flexible%2C%20and%20secure%20way.
- Tabs
- Seem to be just iFrames, embedded web content into the Teams app
- Activity Feed notifications
- Could be a decent option, but would have our notifications lumped in with other general activity feed notifications, rather than be in a dedicated chat or channel