-1

I am working on a small project trying to control some steps of a workflow in a web application using MS teams. My idea is to use R as an intermediate step between the application (which has a number of API endpoints I can call from R) and Microsoft Teams chats (or channels). Users would then use a set of keywords in the chat to lead to an action in the application. For example they might use "publish ABC-123" in a specific chat and this would lead to the application publishing document ABC-123 somewhere via R which would orchestrate everything.

I have a couple of ideas but there are drawbacks:

  1. I thought originally about using microsoft365r. We have an app registered in Microsoft 365 which would allow us to monitor a specific chat for messages that trigger actions in R. The problem with this approach is that we would need to have the R code running and checking MS Teams every couple of minutes. It is certainly doable, but not very elegant.
  2. Another option could be setting up a plumber API and an outgoing webhook in MS Teams. This seems like the ideal way to do it, but webhooks in MS Teams require https and as far as I understand this is not straightforward to implement in plumber.

I would appreciate any ideas on how to do this. I know I am not very specific, but mostly looking for high level pointers of what I could look at. Many thanks!

Gakku
  • 337
  • 2
  • 8

1 Answers1

0

You actually have a bunch of options for this:

  1. Create a bot directly in code, e.g. per https://learn.microsoft.com/en-us/microsoftteams/platform/bots/what-are-bots . There's a bit of a learning curve of course, and it depends on whether you have development skills outside of r, e.g. python, .net, whatever. The bot would then call your code as needed.

  2. Create a no-code bot using Power Virtual Agents. This is the equivalent, for bots, of Power Apps or Power Automate, if you're familiar with those.

  3. Create a workflow, either in Power Automate or Azure Logic Apps, that can listen for and respond to messages. This is kind of similar to a bot, but with finer scope (and therefore less capability). If you want it to call out to your app, e.g. to an endpoint, you'd need a Premium Connecter for Power Automate, or you can use an Azure Logic App directly (uses the same engine, but the pricing model is different for these and Power Automate is a little easier to work with.

  4. Outgoing webhook - you can implement these as standalone, but actually from your use case it sounds like a bot would be better anyway, and it's kind of what you need to build to make this kind of webhook work properly anyway.

Hilton Giesenow
  • 9,809
  • 2
  • 10
  • 24
  • Thanks for the tips! Am I right that to communicate with APIs I need a "Premium" http connector for all the options (possibly not for option 1 but I'm not very fluent in python unfortunately). I will look into this with our IT team next week. – Gakku Nov 13 '22 at 13:30
  • 1
    For option 1, you don't need Python per se, but you need skills in one of the suppoted Bot Framework languages (usually .Net, Python or Node). For option 3, as mentioned, you can create an Azure Logic App instead - Power Automate is basically built on top of that, so it's a similar experience (a little more raw, but similar). Pricing depends on executions I think, but it's quite cheap, compared to a Premium connector. – Hilton Giesenow Nov 13 '22 at 15:17