How to create connector programmatically?

%3CLINGO-SUB%20id%3D%22lingo-sub-1191787%22%20slang%3D%22en-US%22%3EHow%20to%20create%20connector%20programmatically%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1191787%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20web%20application%20that%20has%20channels%20that%20I%20would%20like%20to%20allow%20the%20users%20to%20map%201%3A1%20to%20channels%20in%20Teams.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20channels%20will%20always%20keep%20the%201%3A1%20mapping%20so%20as%20they%20create%20channels%20in%20the%20application%20or%20teams%20I%20would%20like%20to%20have%20them%20be%20able%20to%20create%20a%20connector%20between%20the%20two%20so%20that%20they%20can%20send%20massages%20to%20Teams.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20already%20completed%20this%20with%20Slack%20(%3CA%20href%3D%22https%3A%2F%2Fapi.slack.com%2Fmessaging%2Fwebhooks%23generating_incoming_webhook_urls_programmatically%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fapi.slack.com%2Fmessaging%2Fwebhooks%23generating_incoming_webhook_urls_programmatically%3C%2FA%3E).%26nbsp%3B%20But%20the%20documentation%20for%20Teams%20makes%20it%20seem%20like%20a%20connector%20is%20a%20static%2Frigid%20entity%20that%20has%20to%20be%20manually%20mapped%20by%20a%20user.%26nbsp%3B%20Is%20this%20true%3F%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20so%20what%20is%20anot%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1191787%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%20Connector%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1192653%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20create%20connector%20programmatically%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1192653%22%20slang%3D%22en-US%22%3E%3CP%3EPlease%20take%20a%20look%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2Fmicrosoft-teams-sample-connector-csharp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ETeams%20connector%20sample%20code.%3C%2FA%3E%3C%2FP%3E%0A%3CP%3ELet%20me%20know%20if%20this%20doesn't%20help%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1193775%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20create%20connector%20programmatically%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1193775%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F371090%22%20target%3D%22_blank%22%3E%40Trinetra-MSFT%3C%2FA%3E%26nbsp%3BLooking%20at%20these%20examples%20I%20don't%20think%20a%20connector%20is%20what%20I%20need.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20have%20more%20flexibility%20and%20not%20need%20the%20user%20to%20manually%20install%20it%20to%20every%20team%20in%20their%20organization%20then%20enable%20it%20on%20each%20channel.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELooking%20at%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fchannel-post-messages%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGraph%20API%3C%2FA%3E%26nbsp%3Bit%20looks%20like%20utilizing%20oAuth%20to%20get%20a%20token%2C%20then%20being%20able%20to%20post%20a%20message%20to%20any%20channel%20on%20any%20team%20on%20behalf%20of%20a%20user%20is%20the%20functionality%20I%20am%20looking%20for.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EHowever%2C%20to%20request%20the%20permission%3C%2FP%3E%3CDIV%3E%26nbsp%3B%3CSPAN%3E%3CSPAN%3E%22%3CA%20href%3D%22https%3A%2F%2Flogin.microsoftonline.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Flogin.microsoftonline.com%2F%3C%2FA%3E%3C%2FSPAN%3E%3C%2FSPAN%3Eorganizations%2Foauth2%2Fv2.0%2Fauthorize%22%3CBR%20%2F%3E%3CBR%20%2F%3EIt%20looks%20like%20the%20Teams%20account%20has%20to%20be%20work%20or%20school%20which%20is%20fine%2C%20but%20that%20the%20user%20requesting%20it%20has%20to%20be%20the%20administrator.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EHow%20can%20I%20set%20up%20a%20test%20environment%20for%20this%3F%20When%20I%20create%20my%20own%20teams%20account%20it%20is%20setup%20as%20personal.%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1208794%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20create%20connector%20programmatically%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1208794%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F567036%22%20target%3D%22_blank%22%3E%40adamhouck%3C%2FA%3E%26nbsp%3B%2C%20Please%20take%20a%20look%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fconcepts%2Fbuild-and-test%2Fprepare-your-o365-tenant%23enable-microsoft-teams-for-your-organization%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eenable%20teams%20for%20your%20org.%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

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
Highlighted

Please take a look Teams connector sample code.

Let me know if this doesn't help you.

Highlighted

@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 Graph API 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.
Highlighted