Upravit

Sdílet prostřednictvím


chatMessageMention resource type

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

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

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.
mentionText string String used to represent the mention. For example, a user's display name, a team name.
mentioned chatMessageMentionedIdentitySet The entity (user, application, team, channel, or chat) that was @mentioned.

JSON representation

The following JSON representation shows the resource type.

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