Skip to content

Commit 3c95252

Browse files
authored
Merge pull request #25357 from microsoftgraph/users/sumanac/everyonementionv1.0
Mention everyone in chat for v1.0
2 parents e93f39d + d6b18da commit 3c95252

File tree

6 files changed

+49
-25
lines changed

6 files changed

+49
-25
lines changed

api-reference/v1.0/api/chatmessage-get.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -531,26 +531,26 @@ Content-type: application/json
531531
}
532532
```
533533

534-
### Example 6: Get a chat message with a forwarded message
534+
### Example 5: Get a chat message with an @mention for everyone
535535

536-
The following example shows a request that gets a chat message with a forwarded message as an attachment.
536+
The following example shows a request to get a chat message that @mentions everyone in a group chat.
537537

538538
#### Request
539539

540540
The following example shows a request.
541541

542542
<!-- {
543543
"blockType": "request",
544-
"name": "get_chatmessage_6",
545-
"sampleKeys": ["19:e2ed97baac8e4bffbb91299a38996790@thread.v2", "1727903166936"]
544+
"name": "get_chatmessage_5",
545+
"sampleKeys": ["19:80a7ff67c0ef43c19d88a7638be436b1@thread.v2", "1725986575123"]
546546
}-->
547547
```msgraph-interactive
548-
GET https://graph.microsoft.com/v1.0/chats/19:e2ed97baac8e4bffbb91299a38996790@thread.v2/messages/1727903166936
548+
GET https://graph.microsoft.com/v1.0/chats/19:80a7ff67c0ef43c19d88a7638be436b1@thread.v2/messages/1725986575123
549549
```
550550

551551
#### Response
552552

553-
The following example shows the response. The message body contains a forwarded message as an attachment. The **contentType** for the forwarded message is identified as `forwardedMessageReference`. The original message that was forwarded is also available in the attachment **content**.
553+
The following example shows the response. The message body contains an @mention for everyone in a group chat that is represented by the `<at></at>` tag. The **conversationIdentityType** property is set to `chat` in the **conversation** identity of the **mentioned** object.
554554

555555
<!-- {
556556
"blockType": "response",
@@ -575,7 +575,7 @@ Content-type: application/json
575575
"deletedDateTime": null,
576576
"subject": null,
577577
"summary": null,
578-
"chatId": "19:e2ed97baac8e4bffbb91299a38996790@thread.v2",
578+
"chatId": "19:80a7ff67c0ef43c19d88a7638be436b1@thread.v2",
579579
"importance": "normal",
580580
"locale": "en-us",
581581
"webUrl": null,
@@ -589,27 +589,33 @@ Content-type: application/json
589589
"user": {
590590
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
591591
"id": "28c10244-4bad-4fda-993c-f332faef94f0",
592-
"displayName": null,
592+
"displayName": "Adele Vance",
593593
"userIdentityType": "aadUser",
594594
"tenantId": "2432b57b-0abd-43db-aa7b-16eadd115d34"
595595
}
596596
},
597597
"body": {
598598
"contentType": "html",
599-
"content": "<attachment id=\"1727881360458\"></attachment>"
599+
"content": "<p>Hi&nbsp;<at id=\"0\">Everyone</at></p>"
600600
},
601-
"attachments": [
601+
"attachments": [],
602+
"mentions": [
602603
{
603-
"id": "1727881360458",
604-
"contentType": "forwardedMessageReference",
605-
"contentUrl": null,
606-
"content": "{\"originalMessageId\":\"1727881360458\",\"originalMessageContent\":\"\\n<p>hello</p>\\n\",\"originalConversationId\":\"19:97641583cf154265a237da28ebbde27a@thread.v2\",\"originalSentDateTime\":\"2024-10-02T15:02:40.458+00:00\",\"originalMessageSender\":{\"application\":null,\"device\":null,\"user\":{\"userIdentityType\":\"aadUser\",\"tenantId\":\"2432b57b-0abd-43db-aa7b-16eadd115d34\",\"id\":\"28c10244-4bad-4fda-993c-f332faef94f0\",\"displayName\":null}}}",
607-
"name": null,
608-
"thumbnailUrl": null,
609-
"teamsAppId": null
604+
"id": 0,
605+
"mentionText": "Everyone",
606+
"mentioned": {
607+
"application": null,
608+
"device": null,
609+
"user": null,
610+
"tag": null,
611+
"conversation": {
612+
"id": "19:80a7ff67c0ef43c19d88a7638be436b1@thread.v2",
613+
"displayName": "Everyone",
614+
"conversationIdentityType": "chat"
615+
}
616+
}
610617
}
611618
],
612-
"mentions": [],
613619
"reactions": []
614620
}
615621
```

api-reference/v1.0/resources/chatmessage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Represents an individual chat message within a [channel](channel.md) or [chat](c
7575
|lastModifiedDateTime|dateTimeOffset|Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed. |
7676
|lastEditedDateTime|dateTimeOffset|Read only. Timestamp when edits to the chat message were made. Triggers an "Edited" flag in the Teams UI. If no edits are made the value is `null`.|
7777
|locale|string|Locale of the chat message set by the client. Always set to `en-us`.|
78-
|mentions|[chatMessageMention](chatmessagemention.md) collection| List of entities mentioned in the chat message. Supported entities are: user, bot, team, and channel.|
78+
|mentions|[chatMessageMention](chatmessagemention.md) collection| List of entities mentioned in the chat message. Supported entities are: user, bot, team, channel, chat, and tag.|
7979
|messageHistory|[chatMessageHistoryItem](../resources/chatmessagehistoryitem.md) collection|List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message.
8080
|messageType|chatMessageType|The type of chat message. The possible values are: `message`, `chatEvent`, `typing`, `unknownFutureValue`, `systemEventMessage`. Note that you must use the `Prefer: include-unknown-enum-members` request header to get the following value in this [evolvable enum](/graph/best-practices-concept#handling-future-members-in-evolvable-enumerations): `systemEventMessage`.|
8181
|policyViolation | [chatMessagePolicyViolation](chatmessagepolicyviolation.md) |Defines the properties of a policy violation set by a data loss prevention (DLP) application.|

api-reference/v1.0/resources/chatmessagemention.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "chatMessageMention resource type"
3-
description: "Represents a mention in a chatMessage entity. The mention can be to a user, team, bot or channel. "
3+
description: "Represents a mention in a chatMessage entity."
44
ms.localizationpriority: medium
55
author: "RamjotSingh"
66
ms.subservice: "teams"
@@ -12,7 +12,7 @@ ms.date: 09/16/2024
1212

1313
Namespace: microsoft.graph
1414

15-
Represents a mention in a [chatMessage](chatmessage.md) entity. The mention can be to a [user](user.md), [team](team.md), bot, or [channel](channel.md).
15+
Represents a mention in a [chatMessage](chatmessage.md) entity. The mention can be to a [user](user.md), [team](team.md), bot, [channel](channel.md), or [chat](chat.md).
1616

1717
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.
1818

@@ -35,7 +35,7 @@ For a fuller context of the example, see [List channel message replies](../api/c
3535
| Property | Type |Description|
3636
|:---------------|:--------|:----------|
3737
|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.|
38-
|mentioned|[chatMessageMentionedIdentitySet](chatmessagementionedidentityset.md)|The entity (user, application, team, or channel) that was @mentioned.|
38+
|mentioned|[chatMessageMentionedIdentitySet](chatmessagementionedidentityset.md)|The entity (user, application, team, channel, or chat) that was @mentioned.|
3939
|mentionText|string|String used to represent the mention. For example, a user's display name, a team name.|
4040

4141

api-reference/v1.0/resources/chatmessagementionedidentityset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Inherits from [identitySet](../resources/identityset.md).
2121
|Property|Type|Description|
2222
|:---|:---|:---|
2323
|application|[identity](../resources/identity.md)|Inherited from [identitySet](../resources/identityset.md). If present, represents an application (for example, bot) @mentioned in a [message](../resources/chatmessage.md).|
24-
|conversation|[teamworkConversationIdentity](../resources/teamworkconversationidentity.md)|If present, represents a conversation (for example, team or channel) @mentioned in a [message](../resources/chatmessage.md).|
24+
|conversation|[teamworkConversationIdentity](../resources/teamworkconversationidentity.md)|If present, represents a conversation (for example, team, channel, or chat) @mentioned in a [message](../resources/chatmessage.md).|
2525
|device|[identity](../resources/identity.md)|Inherited from [identitySet](../resources/identityset.md). Not used because it's not supported to @mention devices.|
2626
|user|[identity](../resources/identity.md)|Inherited from [identitySet](../resources/identityset.md). If present, represents a user @mentioned in a [message](../resources/chatmessage.md).|
2727

changelog/Microsoft.Teams.Core.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5699,6 +5699,24 @@
56995699
"SubArea": "Messaging"
57005700
},
57015701
{
5702+
"ChangeList": [
5703+
{
5704+
"Id": "f9666fc8-6101-4ca6-bd26-3f11395ffc5f",
5705+
"ApiChange": "Property",
5706+
"ChangedApiName": "mentions",
5707+
"ChangeType": "Change",
5708+
"Description": "Added `chat` as a supported value for the **mentions** property in the [chatMessage](https://learn.microsoft.com/en-us/graph/api/resources/chatmessage?view=graph-rest-1.0) resource.",
5709+
"Target": "chatMessage"
5710+
}
5711+
],
5712+
"Id": "f9666fc8-6101-4ca6-bd26-3f11395ffc5f",
5713+
"Cloud": "Prod",
5714+
"Version": "v1.0",
5715+
"CreatedDateTime": "2024-10-08T18:15:55.2254479Z",
5716+
"WorkloadArea": "Teamwork and communications",
5717+
"SubArea": ""
5718+
},
5719+
{
57025720
"ChangeList": [
57035721
{
57045722
"Id": "5527a808-1e9a-4fa0-b52b-869cd2b870be",

concepts/whats-new-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ For details about previous updates to Microsoft Graph, see [Microsoft Graph what
1717
> [!IMPORTANT]
1818
> Features in _preview_ status are subject to change without notice, and might not be promoted to generally available (GA) status. Don't use preview features in production apps.
1919
20-
## January 2025: New and generally available
20+
## January 2025: New and generally available
2121

2222
### Teamwork and communications | Messaging
2323

24-
[Get](/graph/api/chatmessage-get#example-6-get-a-chat-message-with-a-forwarded-message) a chat message that has a forwarded message as an attachment.
24+
[Get](/graph/api/chatmessage-get#example-5-get-a-chat-message-with-an--for-everyone) a chat message with an @mention for everyone.
2525

2626
## January 2025: New in preview only
2727

0 commit comments

Comments
 (0)