I'm currently working on a custom integration with Microsoft Teams. The goal of the integration is to allow all my customers to install the integration and fetch a list of channels and users and then send formatted messages to selected channels and users from within our system. I'd like the author of the message to be set to the name of my company not the user who integrated with Microsoft Teams. I've already tested Graph API but I wasn't able to send a message as Company, only as the authenticated user. According to this page: https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/capabilities-overview I have a few more options available: Connectors and Bots. I've been wondering which one would fit best. Any guidance would be greatly appreciated. Thanks!
1 Answers
So you -can- send to channels using Connectors, but not directly (privately) to a user, you'd need a bot for that. In addition, connectors can only send message -in- to Teams (basically as an incoming webhook - see here: https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using). If you're wanting the user to be able to respond (via @mention or via sending a card with a button that the user is expected to click on) then the connector / incoming webhook again would not be sufficient.
The example shown in the link above includes a MessageCard with an httpPost option, so that might still fill your needs of having a clickable button, but it's got some other limitations to be aware of, fyi.
In order to do the sending as a Bot, you'd be using a concept called "pro-active messaging". Here's a sample on how to do this, and at the bottom of the page is a list of "further reading" that is quite useful as background.
With regards your point about the naming, you can call your Connector or your Bot by any name you like, but with the bot it needs to be something unique in the entire Azure Bot landscape (like for example nothing else in the App Store with that name). Important to know that it can't be customized per tenant if you wanted to use it across multiple tenants though (like each tenant has a different name for the bot) - you'd need to do that another way (there are a few options).