Send messages on teams on behalf of app

Nitin S 31 Reputation points
2021-06-05T18:13:16.027+00:00

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

Can i achieve it by creating teams app or bot?

Thanks.

Microsoft Teams | Development
Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Choudhary 606 Reputation points Microsoft Employee
    2021-06-07T13:06:43.123+00:00

    @Nitin S It's a good idea to build Bot and send notifications for your scenario. You can use Proactive message to send message.
    Also please note that in order to send message, your Bot needs to be installed for each user (since application permissions are not yet there).

    You can install the app in personal scope. You can use Subscriptions for /chats/allMessages -- all chat messages in organization and then notify user in 1:1 using bot.

    Unfortunately at the moment, you cannot use Microsoft graph for this. Being said that, please file user voice for your scenario so that it could be considered for future implementations.

    Please upvote if this helps. Thanks!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.