Search code examples
javascriptnode.jsbotframeworkmicrosoft-graph-apimicrosoft-teams

Link to message posted by Bot in MSTeams


How can I get the link( which I got on clicking the 3 dots of a message) of all messages posted to the channel by my bot? After getting this link, I want to DM the link to the user through the bot.

enter image description here


Solution

  • You can take a look at list channel messages API. This will give you the message_id and channel _id later you can try to deep link https://teams.microsoft.com/l/message/{channel_id}/{message_id} to same message using message id or channel. There is also alternate solution for this, subscribe to channel using change notification API. You will be getting all the messages of channel to notification endpoint, you can Deserialize the message payload you will find the copy link url in the payload it self.