SOLVED

Is it possible, To send message Individually (Personally) in MS Teams using graph API ?

%3CLINGO-SUB%20id%3D%22lingo-sub-1030161%22%20slang%3D%22en-US%22%3EIs%20it%20possible%2C%20To%20send%20message%20Individually%20(Personally)%20in%20MS%20Teams%20using%20graph%20API%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1030161%22%20slang%3D%22en-US%22%3E%3CP%3EI%20want%20to%20send%20personal%20message%20to%20anyone%20in%20MS%20Teams%20using%20graph%20API%20%2C%20Is%20it%20possible%26nbsp%3B%20if%20possible%20how..%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1030161%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EGraph%20API%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EGraphAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1033384%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20possible%2C%20To%20send%20message%20Individually%20(Personally)%20in%20MS%20Teams%20using%20graph%20API%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1033384%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F468104%22%20target%3D%22_blank%22%3E%40Deepak1265%3C%2FA%3E%26nbsp%3B%20I%20got%20solution%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20Get%20%22User%20Id%22%20of%20user%20you%20want%20to%20send%20a%20message%3CBR%20%2F%3EGET%20%3A%20-%20%22%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fusers%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fusers%2F%3C%2FA%3E%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20Get%20chat%20id%20of%20a%20user%3CBR%20%2F%3EGET%20%3A%20-%20%22%2F%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FUSER_ID%2Fchats%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FUSER_ID%2Fchats%3C%2FA%3E%22%3C%2FP%3E%3CP%3Ecopy%20the%20Chat%20%22Id%22%26nbsp%3B%20on%20top%20the%20list%20one%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158963i04C6EB81884BF58C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22picture2.jpg%22%20title%3D%22picture2.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E3.%20You%20can%20also%20get%20previous%20message%20list%3CBR%20%2F%3EGET%20%3A%20-%20%22%2F%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FUSER_ID%2Fchats%2FCHAT_ID%2Fmessages%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FUSER_ID%2Fchats%2FCHAT_ID%2Fmessages%3C%2FA%3E%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E4%20.%20For%20Send%20a%20new%20message%3CBR%20%2F%3EPOST%3A%20-%20%22%2F%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FUSER_ID%2Fchats%2FCHAT_ID%2Fmessages%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FUSER_ID%2Fchats%2FCHAT_ID%2Fmessages%3C%2FA%3E%22%3C%2FP%3E%3CP%3ERequest%20Body%20%3A%20-%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22body%22%3A%20%7B%3CBR%20%2F%3E%22content%22%3A%20%22%20your%20message%20%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1032063%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20possible%2C%20To%20send%20message%20Individually%20(Personally)%20in%20MS%20Teams%20using%20graph%20API%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1032063%22%20slang%3D%22en-US%22%3EChat%20messages%20are%20in%20preview.%20%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fchatmessage%3Fview%3Dgraph-rest-beta%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fchatmessage%3Fview%3Dgraph-rest-beta%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EAll%20functionalities%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fteams-api-overview%3Fview%3Dgraph-rest-1.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fteams-api-overview%3Fview%3Dgraph-rest-1.0%3C%2FA%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I want to send personal message to anyone in MS Teams using graph API , Is it possible  if possible how..?

2 Replies
best response confirmed by Deepak1265 (Occasional Contributor)
Solution

@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

picture2.jpg

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 "
}
}

www.000webhost.com