1
votes

I am using Microsoft team integration using nodejs. In the Teams client you can easily copy a link to the conversation and this can be used to navigate to the specific conversation any time.

see the screenshot for the reference: https://www.dropbox.com/s/fog3ojddcb6mdis/screen%20shot%202021-02-10%20at%202.44.31%20pm.png?dl=0

Is there a way to get this link in the botframework when the conversation is created? I have seen there are deep link apis for group chat etc. which requires the list of users to be provided.

but I am interested in obtaining the conversation link that appears on client.

This one is not useful https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links

The activity object I get in nodejs on starting a conversation is:

{
  "localTimestamp": "2021-02-13T05:42:25.313Z",
  "timestamp": "2021-02-13T05:42:25.313Z",
  "type": "message",
  "locale": "en-US",
  "from": {
    "name": "Stacy",
    "id": "29:1a-Xb7uPrMwF2XqjMEHCC7ytV2xb2VUCqTA-n_s-k5ZyMCTKIL-ku2XkgbE167D_5ZbmVaqQxJGIQ13vypSqu-A",
    "aadObjectId": "718ab805-850c-43ec-8d4e-4af0c543df75"
  },
  "serviceUrl": "https://smba.trafficmanager.net/amer/",
  "conversation": {
    "isGroup": true,
    "conversationType": "channel",
    "id": "19:a0a0088174a644cb91406f4d8f79d888@thread.tacv2;messageid=1613194945273",
    "tenantId": "04e934f3-0866-4a6d-b07c-a4737e8f9865"
  },
  "localTimezone": "America/Los_Angeles",
  "recipient": {
    "name": "MyBot",
    "id": "28:a835cf1d-83a8-5ae9-845a-23a68a1df442"
  },
  "id": "1613194445273",
  "channelData": {
    "channel": {
      "id": "19:a0a0088174a644cb91459f4d8f79d888@thread.tacv2"
    },
    "tenant": {
      "id": "04e930f3-0866-4a6d-c07c-a4737e8f9865"
    },
    "team": {
      "id": "19:774d4103fe51420db1437130378b196e@thread.tacv2"
    },
    "teamsChannelId": "19:a0a0088174a644cb91409f5d8f79d888@thread.tacv2",
    "teamsTeamId": "19:774d4103fe51420db1437190478b196e@thread.tacv2"
  },
  "attachments": [
    {
      "contentType": "text/html",
      "content": "<div><div><span itemscope=\"\" itemtype=\"http://schema.skype.com/Mention\" itemid=\"0\">MyBot</span> opty&nbsp;</div>\n</div>"
    }
  ],
  "textFormat": "plain",
  "channelId": "msteams",
  "entities": [
    {
      "text": "<at>MyBot</at>",
      "mentioned": {
        "id": "28:a835cf1d-83a8-4ae9-845a-23a68a1df432",
        "name": "MyBot"
      },
      "type": "mention"
    },
    {
      "country": "US",
      "platform": "Mac",
      "timezone": "America/Los_Angeles",
      "locale": "en-US",
      "type": "clientInfo"
    }
  ],
  "text": "opty"
}

1

1 Answers

0
votes

You can use Get Chat Graph API

POST: https://graph.microsoft.com/beta/me/chats

These permission needs to be given at delegated level to the Application Chat.ReadBasic, Chat.Read, Chat.ReadWrite

You can will be able to see chatType/Topic base on that you can get the chatId and pass it to Get Message in Chat, So in the end you can use the deep link and create deep link to chat using https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links#generating-a-deep-link-to-a-chat

Note: While creating deep link to specific message in group chat, you should have the group chat id and message id. Message Id you can get it within Bot activity and use it later to create deep link.