chatMessageMention resource type

Namespace: microsoft.graph

Represents a mention in a chatMessage entity. The mention can be to a user, team, bot, or channel.

In a chatMessage object that contains one or more mentions, the message body content property represents the chat message in HTML. It encloses the mentionText of each mention in an HTML at element, with an id attribute that corresponds to the id property of the mention.

As an example, a chat message contains two mentions, with the mention text "Megan" and "Alex" respectively. Its body content property specifies at elements for the two mentions as follows:

"body": {
    "contentType": "html",
    "content": "<div><div>Ah, <at id=\"0\">Megan</at>, <at id=\"1\">Alex</at>, I saw them in a separate folder. Thanks!</div>\n</div>"
}

In the content property, the first mention has an HTML id attribute of 0. This corresponds to the id property of that first instance of chatMessageMention, which is also 0.

The second mention has an id attribute of 1, matching the id property of the second instance, which is 1.

For a fuller context of the example, see List channel message replies.

Properties

Property Type Description
id Int32 Index of an entity being mentioned in the specified chatMessage. Matches the {index} value in the corresponding <at id="{index}"> tag in the message body.
mentioned chatMessageMentionedIdentitySet The entity (user, application, team, or channel) that was @mentioned.
mentionText string String used to represent the mention. For example, a user's display name, a team name.

JSON representation

The following JSON representation shows the resource type.

{
  "id": 1024,
  "mentioned": {"@odata.type": "microsoft.graph.chatMessageMentionedIdentitySet"},
  "mentionText": "string"
 }