Thank you for posting your question in the Microsoft Q&A forum.
I’ve conducted a test of the Microsoft Graph API in my development environment, and everything appears to be functioning correctly.
Below, I’ve outlined the steps I followed to successfully send a message to a Microsoft Teams chat, which may help you troubleshoot your issue:
- Retrieve the Chat ID
GET https://graph.microsoft.com/v1.0/me/chats
From the response, identify and copy a valid chat ID.
- Send a Message to the Chat
POST https://graph.microsoft.com/v1.0/chats/{chat-id}/messages
Replace {chat-id} with the actual ID from step 1.
Ensure that your application has been granted the following delegated permissions:
ChatMessage.Send
Chat.ReadWrite
Group.ReadWrite.All
These permissions are essential for sending messages to Teams chats. You can find detailed information about each permission here: Microsoft Graph permissions reference - Microsoft Graph | Microsoft Learn
If you're unsure how to configure permissions, please follow these steps:
If these permissions are not properly configured, you may encounter errors such as 401 Unauthorized or 404 Not Found when making API calls.
I hope these details help you resolve the issue.
Please understand that our forum is a public platform, and we will modify your question to cover your organization domain name in the description. Please notice to hide these personal or organization information next time you post error or some information to protect personal data.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.