'How to mention the team-tag when sending message in channel

Currently, I have a chat-bot app that sends the message on the channel.

Also, it is capable of tagging a user. The below code is responsible for sending user mentioned message.

await turnContext.sendActivity(
 {
    text: `Hello <at>@${members[0].dispName}</at>`,
    entities: [
                {
                            type: 'mention',
                            mentioned: {
                                id: members[0].userName,
                                name: members[0].dispName,
                            },
                            text: `<at>@${members[0].dispName}</at>`,
                }
    ],
});

Further, I am trying to mention the Team Tag. Is there a way I can pass the team-id or something else to mention the Tag

Note: Team tag means - tag in a team

enter image description here



Solution 1:[1]

Now you can create/Get teams tags using Beta Graph API. Reference doc: Create teamworkTag - Microsoft Graph beta | Microsoft Docs

You can also get the created tags using below Beta Graph API: GET /teams/{team-Id}/tags List teamworkTags - Microsoft Graph beta | Microsoft Docs

You can also send the message with mentioning teams tag using below API Post request: https://graph.microsoft.com/v1.0/teams/{team id}/channels/{channel id}/messages

Message body:

{
  "subject": "This is very urgent!",
  "importance": "urgent",
  "body": {
    "contentType": "html",
    "content": "Programmatically mentioning of Tagged users <at id=\"0\">String_1234</at>"
  },
  "mentions": [
    {
      "id": 0,
      "mentionText": "String_1234",
      "mentioned": {
        "tag": {
          "@odata.type": "#microsoft.graph.teamworkTagIdentity",
          "id": ""/*tag id*/,
          "displayName": ""/* tag name*/
        }
      }
    }
  ]
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ChetanSharma-msft