Send messages on teams on behalf of the app.

%3CLINGO-SUB%20id%3D%22lingo-sub-2420987%22%20slang%3D%22en-US%22%3ESend%20messages%20on%20teams%20on%20behalf%20of%20the%20app.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2420987%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20able%20to%20send%20send%20messages%20on%20a%20team's%20channel%20by%20using%3CBR%20%2F%3EPOST-%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fteams%2F%257Bteam_id%257D%2Fchannels%2F%257Bchannel_id%257D%2Fmessages%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fteams%2F%7Bteam_id%7D%2Fchannels%2F%7Bchannel_id%7D%2Fmessages%3C%2FA%3E%3C%2FP%3E%3CP%3EBut%20this%20api%20is%20sending%20messages%20on%20behlaf%20of%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22http%3A%2F%2Fuser.is%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Euser.Is%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ethere%20any%20way%20i%20can%20send%20these%20messages%20on%20behlaf%20of%20application.I%20mean%20instead%20of%20user's%20name%20my%20application%20name%20will%20reflect.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENitin%20-%26gt%3B%20Hi%20this%20is%20nitin's%20app.%20WRONG%3C%2FP%3E%3CP%3ENitinApp%20-%26gt%3B%20Hi%20this%20is%20nitin's%20app%20RIGHT%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20achieve%20it%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20task%20is%20to%20create%20a%20company%20app%2Fbot%20which%20can%20send%20notifications%20to%20our%20client's%20teams.Every%20client%20has%20its%20own%20microsoft%2Fteams%20organization%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22http%3A%2F%2Faccount.so%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Eaccount.%20So%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eif%20any%20client%20wants%20to%20get%20notify%20from%20our%20app%20first%20he%20will%20have%20to%20authenticate%20our%20app%20and%20set%20a%20channel.After%20that%20our%20app%20will%20send%20messages%20to%20that%20channel(Not%20on%20behalf%20of%20user).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example-%20Just%20like%20a%20slack%20app.We%20have%20a%20slack%20app%20which%20can%20send%20daily%20report%20notifications%20to%20our%20clients.How%20can%20i%20achieve%20it%20in%20Teams%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20i%20achieve%20it%20by%20creating%20Teams%20app%20or%20bot%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPls%20help..%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2420987%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdministrator%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EApp%20Development%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECommunity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EConversations%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMessaging%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETeams%20Development%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2421110%22%20slang%3D%22en-US%22%3ERe%3A%20Send%20messages%20on%20teams%20on%20behalf%20of%20the%20app.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2421110%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1072532%22%20target%3D%22_blank%22%3E%40nitin1005%3C%2FA%3E%26nbsp%3BThere%20are%20lots%20of%20ways%20to%20do%20this%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20way%20that's%20most%20similar%20to%20Slack%20would%20be%20to%20use%20a%20Webhook%20connector%2C%20right%20click%20on%20a%20channel%20to%20get%20to%20connectors%20and%20choose%20incoming%20webhook%2C%20you%3Bll%20get%20a%20web%20url%20that%20you%20post%20messages%20to%20and%20they%20will%20appear%20in%20that%20channel%20as%20being%20from%20the%20app.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnother%20alternative%20is%20to%20develop%20a%20Bot%20to%20send%20pro-active%20messages%20to%20a%20channel%2C%20while%20this%20is%20harder%20to%20develop%20it's%20perhaps%20easier%20to%20deploy%20to%20multiple%20tenants.%20More%20on%20Bots%20-%26gt%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fbots%2Fhow-to%2Fconversations%2Fsend-proactive-messages%3Ftabs%3Ddotnet%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESend%20proactive%20messages%20-%20Teams%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2421452%22%20slang%3D%22en-US%22%3ERe%3A%20Send%20messages%20on%20teams%20on%20behalf%20of%20the%20app.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2421452%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F178440%22%20target%3D%22_blank%22%3E%40Steven%20Collier%3C%2FA%3E%26nbsp%3BThanks%20for%20your%20help.%3C%2FP%3E%3CP%3EI%20have%20few%20more%20queries%20for%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1-%20What%20type%20of%20accounts%20do%20i%20need%20for%20this%3F%26nbsp%3B%3C%2FP%3E%3CP%3E2-%20Do%20i%20have%20to%20take%20subscription%20of%20office365%20and%20azure%20for%20whole%20development(creation%20to%20distribution%20of%20app%20)%20or%20can%20i%20do%20this%20by%20using%20basic%20accounts%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

 

I am able to send send messages on a team's channel by using
POST- https://graph.microsoft.com/v1.0/teams/{team_id}/channels/{channel_id}/messages

But this api is sending messages on behlaf of user.Is there any way i can send these messages on behlaf of application.I mean instead of user's name my application name will reflect.

 

Nitin -> Hi this is nitin's app. WRONG

NitinApp -> Hi this is nitin's app RIGHT

 

Is there any way to achieve it?

 

My task is to create a company app/bot which can send notifications to our client's teams.Every client has its own microsoft/teams organization account. So if any client wants to get notify from our app first he will have to authenticate our app and set a channel.After that our app will send messages to that channel(Not on behalf of user).

 

For example- Just like a slack app.We have a slack app which can send daily report notifications to our clients.How can i achieve it in Teams? 

 

Can i achieve it by creating Teams app or bot? 

 

Pls help..

 

Thanks.

3 Replies

@nitin1005 There are lots of ways to do this

 

The way that's most similar to Slack would be to use a Webhook connector, right click on a channel to get to connectors and choose incoming webhook, you;ll get a web url that you post messages to and they will appear in that channel as being from the app.

 

Another alternative is to develop a Bot to send pro-active messages to a channel, while this is harder to develop it's perhaps easier to deploy to multiple tenants. More on Bots -> Send proactive messages - Teams | Microsoft Docs

@Steven Collier Thanks for your help.

I have few more queries for you.

 

1- What type of accounts do i need for this? 

2- Do i have to take subscription of office365 and azure for whole development(creation to distribution of app ) or can i do this by using basic accounts?

 

Thanks.

@nitin1005 

 

1. No account, when you create the connector it can post to the channel, there isn't an account or authentication. In effect the webhook url includes a unique key used for authentication.

2. Not sure I understand.