Global incoming webhook? Or some other way to query List of channels?

Michael Salzer 1 Reputation point
2021-04-12T09:22:11.507+00:00

Is there a way to set something like an incoming webhook for a whole team?

I have a javascript, that should post something to a certain channel contained in a certain Team, but to see in which channel it should be posted, I'd need to get a List of all channels, and since the channels change every month, I can't programm the incoming webhooks statically in the javascript. Is there a possibiltiy to have a javascript query the list of channels in a team so I could compare channel names and let it post into the right channel every time?

Normally I'd say I'd probably need to create a new bot from scratch, but the framework is already in place in my workplace and I'm supposed to use what's already here, which is basically one bot that gets a message and sends a response. Now I'd need to make one that doesn't get a message, but can access teams, query the channels and then send a message. Is that even possible with "just" webhooks?

THanks in advance for any help on this.

Azure Bot Service
Azure Bot Service
An Azure service that provides an integrated environment for bot development.
544 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
1,710 questions
{count} votes

2 answers

Sort by: Most helpful
  1. GiftA-MSFT 11,096 Reputation points
    2021-04-12T16:41:46.183+00:00

    Hi, thanks for reaching out. Would the Graph API List Channels be useful for your scenario?


  2. Michael Salzer 1 Reputation point
    2021-04-28T09:01:13.897+00:00

    My issue hasn't been resolved, because I can't use the Graph API for this. Is there a way to somehow extract a webhook from a user message, so I could send an answer back at a later time via Javascript to where the user sent his message from?

    E.g.
    User sends a message, adressing my "bot"/script, I save the data, and a day later send a message back to the channel the user sent the original message from.

    Is something like that possible without graph?