Hi @Microsoft Q & A
According to the doc:
If you are trying to send a message in a team channel, then grant your application the ChannelMessage.Send
delegation permission and call the POST /teams/{team-id}/channels/{channel-id}/messages
API.
If you're trying to send a message in a chat, then grant your application the ChatMessage.Send
delegated permission and call the POST /chats/{chat-id}/messages
API.
Note that you need to use the delegated authentication flow (auth code flow or ROPC flow) to obtain tokens for the above API endpoints.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.