Home

How to generate or create chat id of MS teams using Graph API ?

%3CLINGO-SUB%20id%3D%22lingo-sub-1035718%22%20slang%3D%22en-US%22%3EHow%20to%20generate%20or%20create%20chat%20id%20of%20MS%20teams%20using%20Graph%20API%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1035718%22%20slang%3D%22en-US%22%3E%3CP%3EI%20got%20the%20list%20of%20chat%20Id's.%20I%20did%20conversation%20in%20MS%20teams%26nbsp%3B%20from%26nbsp%3B%20GET%26nbsp%3B%20-%26nbsp%3B%26nbsp%3B%3CA%20title%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fme%2Fchats%2F%22%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fme%2Fchats%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fme%2Fchats%2F%3C%2FA%3E%26nbsp%3B%20using%20graph%20API%20(Graph%20Explorer)%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20generate%20chat%20Id%20with%20the%20help%20of%20user%20Id%20with%20whom%20I%20never%20chat%20yet.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1035718%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EChat%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%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-1037494%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20generate%20or%20create%20chat%20id%20of%20MS%20teams%20using%20Graph%20API%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1037494%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%20It%20is%20not%20possible%20to%20generate%20a%20chat%20id%20for%20the%20chat%20that%20never%20happened.%20Could%20you%20please%20elaborate%20more%20on%20your%20scenario%20what%20exactly%20you%20are%20trying%20to%20achieve%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1037557%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20generate%20or%20create%20chat%20id%20of%20MS%20teams%20using%20Graph%20API%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1037557%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F359599%22%20target%3D%22_blank%22%3E%40Gousia_Begum%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20chat%20with%20a%20new%20user.%20with%20whom%20I%20never%20chat%20before%3C%2FP%3E%3CP%3ESo%20that%20I%20want%20to%20send%20a%20message%20by%20using%20graph%20API%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPOST%20-%26nbsp%3B%26nbsp%3B%3CA%20title%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fme%2Fchats%2F%22%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fme%2Fchats%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FUSER_ID%2Fchats%2FCHAT_ID%2Fmessages%3C%2FA%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3ERequest%20Body%26nbsp%3B%20%26nbsp%3B-%20%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%22body%22%3A%20%7B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%22content%22%3A%20%22%20message%20%22%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3Bfor%20that%2C%20I%20need%20a%20chat%20Id%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1037976%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20generate%20or%20create%20chat%20id%20of%20MS%20teams%20using%20Graph%20API%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1037976%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%20Currently%20there%20are%20no%20API's%20to%20send%20a%20message%20to%20the%20user%20personally.%20You%20can%20only%20send%20messages%20in%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fchannel-post-messages%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Echannel%20using%20Graph%20API%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1039673%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20generate%20or%20create%20chat%20id%20of%20MS%20teams%20using%20Graph%20API%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1039673%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F359599%22%20target%3D%22_blank%22%3E%40Gousia_Begum%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20can%20send%20a%20message%20to%20the%20user%20personally%2C%20I%20already%20did%20this%20using%3C%2FP%3E%3CP%3E%3CA%20title%3D%22send%20a%20message%20to%20the%20user%20personally%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fchat-post-messages%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EGraph%20API%20Create%20chat%20Message%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F159417iF8E3E24766285F67%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22reply.png%22%20title%3D%22reply.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I got the list of chat Id's. I did conversation in MS teams  from  GET  -  https://graph.microsoft.com/beta/me/chats/  using graph API (Graph Explorer)

Is there any way to generate chat Id with the help of user Id with whom I never chat yet.

4 Replies
Highlighted

@Deepak1265 It is not possible to generate a chat id for the chat that never happened. Could you please elaborate more on your scenario what exactly you are trying to achieve?

Highlighted

@Gousia_Begum 

I want to chat with a new user. with whom I never chat before

So that I want to send a message by using graph API

 

 

POST -  https://graph.microsoft.com/beta/USER_ID/chats/CHAT_ID/messages  

Request Body   - {

                             "body": {
                                             "content": " message "
                                           }
                            }

 

 for that, I need a chat Id

 

Highlighted

@Deepak1265 Currently there are no API's to send a message to the user personally. You can only send messages in a channel using Graph API.

Highlighted

@Gousia_Begum 

 

We can send a message to the user personally, I already did this using

Graph API Create chat Message 

 

reply.png