Send OneOnOne Teams Chat message through Graph API from .NET Core WebAPI without user signed in

Chakravarthi T 1 Reputation point

I have a requirement to send a chat message with parameters (email and message content) using Graph API from my .Net Core Web API.
Without any signed in user I have to send the chat message. Is it possible with Graph API? If not, is there any alternatives?

It is working in Graph explorer but getting Unauthorized or Unknown Error.

Please help me on this.

A set of technologies in the .NET Framework for building web applications and XML web services.
3,145 questions
Microsoft Graph SDK
Microsoft Graph SDK
A Microsoft software developer kit designed to simplify building high-quality, efficient, and resilient applications that access Microsoft Graph.
882 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,189 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Wang-MSFT 1,046 Reputation points

    Hi, @Chakravarthi T ,
    From official document, Microsoft Graph must send chatMessage in a channel or a chat. And I think SignalR is a better choice for the boardcast requirement.

    The SignalR Hubs API enables you to call methods on connected clients from the server. In the server code, you define methods that are called by client. In the client code, you define methods that are called from the server. SignalR takes care of everything behind the scenes that makes real-time client-to-server and server-to-client communications possible.

     Clients.All.broadcastMessage(name, message);  

    If the answer doesn’t solve your issue, please provide more details of error that will help us track down what’s happening.
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,
    Michael Wang