MS Teams connector middle layer between Payload sender and Receiver (msteams channel)

%3CLINGO-SUB%20id%3D%22lingo-sub-1255440%22%20slang%3D%22en-US%22%3EMS%20Teams%20connector%20middle%20layer%20between%20Payload%20sender%20and%20Receiver%20(msteams%20channel)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1255440%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Support%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20created%20one%20custom%20connector%20(using%20MS%20Javascript%20SDK).%20This%20connector%20will%20give%20me%20one%20Incoming%20Webhook%20URL.%20And%20I've%20configured%20the%20Incoming%20URL%20to%20my%20external%20server.%20Now%20Server%20has%20start%20sending%20events%20to%20my%20Channel.%20This%20flow%20working%20fine.%20The%20server%20sends%20events%20to%20MS%20Teams%20Channel%20and%20Channel%20display%20the%20Message%20card%20(payload).%3C%2FP%3E%3CP%3EHere%20I%20need%20control%20in%20code.%20I%20need%20to%20modify%20the%20Payload%20(Message%20card)%20sent%20by%20the%20server.%20So%3C%2FP%3E%3CP%3EWhen%20Server%20sends%20the%20Message%20to%20Channel%20It%20should%20come%20to%20my%20C%23%20application%20and%20I%20want%20to%20change%20the%20payload%20based%20on%20some%20condition%20and%20then%20the%20reply%20back%20to%20the%20channel.%3C%2FP%3E%3CP%3EIn%20Conclusion%2C%20I%20need%20the%20Middle%20layer%20in%20between%20payload%20sender%20and%20receiver%20in%20the%20connector%20flow.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20similar%20conversaion%20link%20I%20found%20%3A%20%3CA%20href%3D%22http%3A%2F%2FBot%20Listening%20to%20every%20message%20in%20a%20teams%20channel%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoft%2Fbotframework-sdk%2Fissues%2F5387%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERef%20link%20for%20Custom%20Connector%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fwebhooks-and-connectors%2Fhow-to%2Fconnectors-creating%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3ELink%20(MS%20Javascript%20Lib)%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdev.to%2Furmade%2Fbuilding-a-microsoft-teams-connector-2bhp%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EExample%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1255440%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1258272%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Teams%20connector%20middle%20layer%20between%20Payload%20sender%20and%20Receiver%20(msteams%20channel)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1258272%22%20slang%3D%22en-US%22%3E%3CP%20data-unlink%3D%22true%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F561606%22%20target%3D%22_blank%22%3E%40NadirRiyani%3C%2FA%3E%26nbsp%3B-%20Could%20you%20please%20take%20a%20look%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fsubscription-post-subscriptions%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EChange%20Notification%20Subscription%3C%2FA%3E.%20Please%20take%20a%20look%20at%20%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fmicrosoft-teams%2Fblogs%2Fannouncing-change-notifications-for-microsoft-teams-messages%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EChange%20notifications%20for%20Microsoft%20Teams%20messages%3C%2FA%3E%20blog.%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3ELet%20me%20know%20if%20that%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1258286%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Teams%20connector%20middle%20layer%20between%20Payload%20sender%20and%20Receiver%20(msteams%20channel)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1258286%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F561606%22%20target%3D%22_blank%22%3E%40NadirRiyani%3C%2FA%3E%26nbsp%3B-%20Could%20you%20please%20try%20the%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%22%3Econnector%20sample%3C%2FA%3E%20where%20we%20are%20sending%20different%20payloads%20when%20a%20task%20is%20created%20vs%20when%20a%20task%20is%20updated%2C%20and%20see%20if%20that%20helps.%20Please%20let%20us%20know%20if%20that%20doesn't%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1258609%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Teams%20connector%20middle%20layer%20between%20Payload%20sender%20and%20Receiver%20(msteams%20channel)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1258609%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F79135%22%20target%3D%22_blank%22%3E%40Wajeed%20Hanif%20Shaik%3C%2FA%3E%26nbsp%3BThanks%20for%20your%20quick%20response.%3C%2FP%3E%3CP%3EIt%20does%20not%20look%20direct%20solution%20to%20the%20issue%20which%20I%20have%20posted.%20It%20looks%20like%20the%20subscription-based%20model.%20Do%20you%20know%20any%20NuGet%20package%20or%20Any%20direct%20Event%20available%20whereas%20the%20developer%20take%20some%20action%20before%20message%20post%20to%20Teams%20via%20Connector.%3F%20Similar%20like%20one%20every%20Bot%20command%20and%20%3CU%3E%3CEM%3EOnTurnAsync%3C%2FEM%3E%3C%2FU%3E%3CEM%3E%26nbsp%3B%3C%2FEM%3Eevent%20raised.%3C%2FP%3E%3CP%3EAnd%20It%20looks%20API%20is%20in%20the%20Beta%20version%20too.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1258657%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Teams%20connector%20middle%20layer%20between%20Payload%20sender%20and%20Receiver%20(msteams%20channel)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1258657%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F561606%22%20target%3D%22_blank%22%3E%40NadirRiyani%3C%2FA%3E%26nbsp%3B-%20In%20that%20case%2C%20you%20could%20create%20an%20Azure%20Function%20which%20receives%20the%20data%20first%20and%20then%20posts%20to%20respective%20Incoming%20Webhook.%26nbsp%3B%3CBR%20%2F%3ESee%20if%20this%20example%20helps%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fvisualstudiomagazine.com%2Farticles%2F2017%2F04%2F01%2Fimplementing-webhooks-azure-functions.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fvisualstudiomagazine.com%2Farticles%2F2017%2F04%2F01%2Fimplementing-webhooks-azure-functions.aspx%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1262009%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Teams%20connector%20middle%20layer%20between%20Payload%20sender%20and%20Receiver%20(msteams%20channel)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1262009%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F79135%22%20target%3D%22_blank%22%3E%40Wajeed%20Hanif%20Shaik%3C%2FA%3E%26nbsp%3B%3A%20That%20I%20understand.%20but%20it%20seems%20there%20would%20more%20data%20traversing%20and%20difficult%20to%20manage%20in%20case%20of%20any%20exception%20or%20any%20issue.%26nbsp%3B%20Is%20there%20any%20event%20directly%20available%20in%20the%20Bot%20framework.%20Like%20%3CEM%3EOnTurnAsync%3C%2FEM%3E%2C%26nbsp%3B%3CEM%3EOnTeamsMembersAddedAsync.%20%3C%2FEM%3ESo%20there%20would%20be%20direct%20action%20when%20the%20message%20gets%20in%20into%20the%20connector.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1262015%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Teams%20connector%20middle%20layer%20between%20Payload%20sender%20and%20Receiver%20(msteams%20channel)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1262015%22%20slang%3D%22en-US%22%3ECurrently%2C%20this%20is%20not%20available%20as%20part%20of%20Bot%20Events.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1263461%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Teams%20connector%20middle%20layer%20between%20Payload%20sender%20and%20Receiver%20(msteams%20channel)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1263461%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F79135%22%20target%3D%22_blank%22%3E%40Wajeed%20Hanif%20Shaik%3C%2FA%3E%26nbsp%3B%3A%20Thank%20you%20for%20your%20valuable%20and%20quick%20support.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hello Support

 

I have created one custom connector (using MS Javascript SDK). This connector will give me one Incoming Webhook URL. And I've configured the Incoming URL to my external server. Now Server has start sending events to my Channel. This flow working fine. The server sends events to MS Teams Channel and Channel display the Message card (payload).

Here I need control in code. I need to modify the Payload (Message card) sent by the server. So

When Server sends the Message to Channel It should come to my C# application and I want to change the payload based on some condition and then the reply back to the channel.

In Conclusion, I need the Middle layer in between payload sender and receiver in the connector flow. 

 

One similar conversaion link I found : https://github.com/microsoft/botframework-sdk/issues/5387 

Ref link for Custom Connector:

6 Replies

@NadirRiyani - Could you please take a look at Change Notification Subscription. Please take a look at Change notifications for Microsoft Teams messages blog. 

 

Let me know if that helps.

@Wajeed-MSFT Thanks for your quick response.

It does not look direct solution to the issue which I have posted. It looks like the subscription-based model. Do you know any NuGet package or Any direct Event available whereas the developer take some action before message post to Teams via Connector.? Similar like one every Bot command and OnTurnAsync event raised.

And It looks API is in the Beta version too.

@NadirRiyani - In that case, you could create an Azure Function which receives the data first and then posts to respective Incoming Webhook. 
See if this example helps: https://visualstudiomagazine.com/articles/2017/04/01/implementing-webhooks-azure-functions.aspx

@Wajeed-MSFT : That I understand. but it seems there would more data traversing and difficult to manage in case of any exception or any issue.  Is there any event directly available in the Bot framework. Like OnTurnAsyncOnTeamsMembersAddedAsync. So there would be direct action when the message gets in into the connector.

 

Currently, this is not available as part of Bot Events.

@Wajeed-MSFT : Thank you for your valuable and quick support.