Skip to content

Commit e93f39d

Browse files
authored
Merge pull request #26089 from microsoftgraph/users/sumanac/getforwardmessagev1.0
Get forward message to v1.0
2 parents f2d6103 + 3510d7a commit e93f39d

File tree

4 files changed

+111
-4
lines changed

4 files changed

+111
-4
lines changed

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

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,89 @@ Content-type: application/json
531531
}
532532
```
533533

534+
### Example 6: Get a chat message with a forwarded message
535+
536+
The following example shows a request that gets a chat message with a forwarded message as an attachment.
537+
538+
#### Request
539+
540+
The following example shows a request.
541+
542+
<!-- {
543+
"blockType": "request",
544+
"name": "get_chatmessage_6",
545+
"sampleKeys": ["19:e2ed97baac8e4bffbb91299a38996790@thread.v2", "1727903166936"]
546+
}-->
547+
```msgraph-interactive
548+
GET https://graph.microsoft.com/v1.0/chats/19:e2ed97baac8e4bffbb91299a38996790@thread.v2/messages/1727903166936
549+
```
550+
551+
#### Response
552+
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**.
554+
555+
<!-- {
556+
"blockType": "response",
557+
"truncated": true,
558+
"@odata.type": "microsoft.graph.chatMessage"
559+
} -->
560+
561+
```http
562+
HTTP/1.1 200 OK
563+
Content-type: application/json
564+
565+
{
566+
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#chats('19%3Ae2ed97baac8e4bffbb91299a38996790%40thread.v2')/messages/$entity",
567+
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET chats('<key>')/messages('<key>')?$select=attachments,body",
568+
"id": "1727903166936",
569+
"replyToId": null,
570+
"etag": "1727903166936",
571+
"messageType": "message",
572+
"createdDateTime": "2024-10-02T21:06:06.936Z",
573+
"lastModifiedDateTime": "2024-10-02T21:06:06.936Z",
574+
"lastEditedDateTime": null,
575+
"deletedDateTime": null,
576+
"subject": null,
577+
"summary": null,
578+
"chatId": "19:e2ed97baac8e4bffbb91299a38996790@thread.v2",
579+
"importance": "normal",
580+
"locale": "en-us",
581+
"webUrl": null,
582+
"channelIdentity": null,
583+
"onBehalfOf": null,
584+
"policyViolation": null,
585+
"eventDetail": null,
586+
"from": {
587+
"application": null,
588+
"device": null,
589+
"user": {
590+
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
591+
"id": "28c10244-4bad-4fda-993c-f332faef94f0",
592+
"displayName": null,
593+
"userIdentityType": "aadUser",
594+
"tenantId": "2432b57b-0abd-43db-aa7b-16eadd115d34"
595+
}
596+
},
597+
"body": {
598+
"contentType": "html",
599+
"content": "<attachment id=\"1727881360458\"></attachment>"
600+
},
601+
"attachments": [
602+
{
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
610+
}
611+
],
612+
"mentions": [],
613+
"reactions": []
614+
}
615+
```
616+
534617
## Related content
535618

536619
- [List messages in a channel](channel-list-messages.md)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ Namespace: microsoft.graph
1414

1515
Represents an attachment to a chat message entity.
1616

17-
An entity of type `chatMessageAttachment` is returned as part of the [Get channel messages](../api/channel-list-messages.md) API, as a part of [chatMessage](chatmessage.md) entity.
17+
An entity of type **chatMessageAttachment** is returned as part of the [Get channel messages](../api/channel-list-messages.md) API, as a part of [chatMessage](chatmessage.md) entity.
1818

1919
## Properties
2020
| Property | Type |Description|
2121
|:---------------|:--------|:----------|
2222
|content|string|The content of the attachment. If the attachment is a [rich card](/microsoftteams/platform/task-modules-and-cards/cards/cards-reference), set the property to the rich card object. This property and contentUrl are mutually exclusive.|
23-
|contentType|string| The media type of the content attachment. It can have the following values: <br><ul><li>`reference`: Attachment is a link to another file. Populate the <b>contentURL</b> with the link to the object.</li><li>Any <b>contentType</b> that is supported by the Bot Framework's [Attachment object](/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?#attachment-object)</li><li>`application/vnd.microsoft.card.codesnippet`: A code snippet. </li><li>`application/vnd.microsoft.card.announcement`: An announcement header. </li>|
24-
|contentUrl|string|The URL for the content of the attachment.|
25-
|id|string|Read-only. The unique id of the attachment.|
23+
|contentType| string | The media type of the content attachment. The possible values are: <br><ul><li>`reference`: The attachment is a link to another file. Populate the <b>contentURL</b> with the link to the object.</li><li>`forwardedMessageReference`: The attachment is a reference to a forwarded message. Populate the <b>content</b> with the original message context.</li><li>Any <b>contentType</b> that is supported by the Bot Framework's [Attachment object](/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?#attachment-object).</li><li>`application/vnd.microsoft.card.codesnippet`: A code snippet. </li><li>`application/vnd.microsoft.card.announcement`: An announcement header. </li>|
24+
|contentUrl|string|The URL for the content of the attachment. |
25+
|id|string| Read-only. The unique ID of the attachment.|
2626
|name|string|The name of the attachment.|
2727
|teamsAppId|string|The ID of the Teams app that is associated with the attachment. The property is used to attribute a Teams message card to the specified app.|
2828
|thumbnailUrl|string|The URL to a thumbnail image that the channel can use if it supports using an alternative, smaller form of **content** or **contentUrl**. For example, if you set **contentType** to application/word and set **contentUrl** to the location of the Word document, you might include a thumbnail image that represents the document. The channel could display the thumbnail image instead of the document. When the user selects the image, the channel would open the document.|

changelog/Microsoft.Teams.Core.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5697,6 +5697,24 @@
56975697
"CreatedDateTime": "2024-10-24T18:15:55.2254479Z",
56985698
"WorkloadArea": "Teamwork and communications",
56995699
"SubArea": "Messaging"
5700+
},
5701+
{
5702+
"ChangeList": [
5703+
{
5704+
"Id": "5527a808-1e9a-4fa0-b52b-869cd2b870be",
5705+
"ApiChange": "Property",
5706+
"ChangedApiName": "contentType",
5707+
"ChangeType": "Change",
5708+
"Description": "Added `forwardedMessageReference` as a supported value for the **contentType** property in the [chatMessageAttachment](https://learn.microsoft.com/en-us/graph/api/resources/chatmessageattachment?view=graph-rest-1.0) resource.",
5709+
"Target": "chatMessageAttachment"
5710+
}
5711+
],
5712+
"Id": "5527a808-1e9a-4fa0-b52b-869cd2b870be",
5713+
"Cloud": "Prod",
5714+
"Version": "v1.0",
5715+
"CreatedDateTime": "2025-01-14T18:15:55.2254479Z",
5716+
"WorkloadArea": "Teamwork and communications",
5717+
"SubArea": "Messaging"
57005718
}
57015719
]
57025720
}

concepts/whats-new-overview.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ 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
21+
22+
### Teamwork and communications | Messaging
23+
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.
25+
2026
## January 2025: New in preview only
2127

2228
### Device and app management | Cloud PC

0 commit comments

Comments
 (0)