Forum Discussion

nitin1005's avatar
nitin1005
Copper Contributor
Jun 07, 2021

Send messages on teams on behalf of the app.

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.

  • 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

    • nitin1005's avatar
      nitin1005
      Copper Contributor

      StevenC365 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.

      • StevenC365's avatar
        StevenC365
        MVP

        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.

Resources