Sending messages to the bot in Teams in automation pipeline

Anton Borkivskyi 0 Reputation points
2025-04-14T16:49:40.9233333+00:00

Description:

Our organization created a bot in MS Teams, and I need to load test it by sending messages to the bot. So, I need to develop a software application that can send automated messages to the bot in Teams.

Firstly, I used my personal access token to send messages to the bot using POST https://graph.microsoft.com/v1.0/chats/{chat_id}/messages endpoint, and the endpoint worked. But this option is not sufficient for automation, as in Delegated API, there is a need for user interaction (entering credentials) to obtain an access token, which is not possible in the automation pipeline.

I have also created an application with client_id and client_secret so that the application and not the user will send such requests. However, the Application API does not support the "Send message in a chat" endpoint.

In terms of a semi-automated pipeline with the user providing access to get an access token, there is an obstacle that one user can only have one chat with a bot; therefore, it is not sufficient for load testing.

Therefore, my questions are:

  • Are there any endpoints missed that can enable sending chat messages to the bot in the automated pipeline?
  • Is there a straightforward solution to do it by several users simultaneously?
  • Is there some general advice on the approach to perform such load testing?
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,483 questions
0 comments No comments
{count} votes

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.