Forum Discussion

adamhouck's avatar
adamhouck
Copper Contributor
Feb 24, 2020

How to create connector programmatically?

I have a web application that has channels that I would like to allow the users to map 1:1 to channels in Teams.

 

The channels will always keep the 1:1 mapping so as they create channels in the application or teams I would like to have them be able to create a connector between the two so that they can send massages to Teams.

 

I've already completed this with Slack (https://api.slack.com/messaging/webhooks#generating_incoming_webhook_urls_programmatically).  But the documentation for Teams makes it seem like a connector is a static/rigid entity that has to be manually mapped by a user.  Is this true?

If so what is anot 

3 Replies

    • adamhouck's avatar
      adamhouck
      Copper Contributor

      Trinetra-MSFT Looking at these examples I don't think a connector is what I need.

       

      I want to have more flexibility and not need the user to manually install it to every team in their organization then enable it on each channel. 

       

      Looking at the https://docs.microsoft.com/en-us/graph/api/channel-post-messages?view=graph-rest-beta&tabs=http it looks like utilizing oAuth to get a token, then being able to post a message to any channel on any team on behalf of a user is the functionality I am looking for.


      However, to request the permission

       "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize"

      It looks like the Teams account has to be work or school which is fine, but that the user requesting it has to be the administrator.
       
      How can I set up a test environment for this? When I create my own teams account it is setup as personal.

Resources