Forum Discussion
Is it possible, To send message Individually (Personally) in MS Teams using graph API ?
I want to send personal message to anyone in MS Teams using graph API , Is it possible if possible how..?
Deepak1265 I got solution
1. Get "User Id" of user you want to send a message
GET : - "https://graph.microsoft.com/v1.0/users/"2. Get chat id of a user
GET : - "/https://graph.microsoft.com/beta/USER_ID/chats"copy the Chat "Id" on top the list one
3. You can also get previous message list
GET : - "/https://graph.microsoft.com/beta/USER_ID/chats/CHAT_ID/messages"4 . For Send a new message
POST: - "/https://graph.microsoft.com/beta/USER_ID/chats/CHAT_ID/messages"Request Body : -
{
"body": {
"content": " your message "
}
}
- Chat messages are in preview.
https://docs.microsoft.com/en-us/graph/api/resources/chatmessage?view=graph-rest-beta
All functionalities:
https://docs.microsoft.com/en-us/graph/api/resources/teams-api-overview?view=graph-rest-1.0 - Deepak1265Copper Contributor
Deepak1265 I got solution
1. Get "User Id" of user you want to send a message
GET : - "https://graph.microsoft.com/v1.0/users/"2. Get chat id of a user
GET : - "/https://graph.microsoft.com/beta/USER_ID/chats"copy the Chat "Id" on top the list one
3. You can also get previous message list
GET : - "/https://graph.microsoft.com/beta/USER_ID/chats/CHAT_ID/messages"4 . For Send a new message
POST: - "/https://graph.microsoft.com/beta/USER_ID/chats/CHAT_ID/messages"Request Body : -
{
"body": {
"content": " your message "
}
}