Skip to content

Commit 114c940

Browse files
committed
Get forward message to v1.0
1 parent a3819e0 commit 114c940

File tree

4 files changed

+104
-4
lines changed

4 files changed

+104
-4
lines changed

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

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,87 @@ Content-type: application/json
530530
]
531531
}
532532
```
533+
### Example 6: Get a chat message with a forwarded message
534+
535+
The following example shows a request that gets a chat message with a forwarded message as an attachment.
536+
537+
#### Request
538+
539+
The following example shows a request.
540+
541+
<!-- {
542+
"blockType": "request",
543+
"name": "get_chatmessage_6",
544+
"sampleKeys": ["19:e2ed97baac8e4bffbb91299a38996790@thread.v2", "1727903166936"]
545+
}-->
546+
```msgraph-interactive
547+
GET https://graph.microsoft.com/beta/chats/19:e2ed97baac8e4bffbb91299a38996790@thread.v2/messages/1727903166936
548+
```
549+
550+
#### Response
551+
552+
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+
554+
<!-- {
555+
"blockType": "response",
556+
"truncated": true,
557+
"@odata.type": "microsoft.graph.chatMessage"
558+
} -->
559+
560+
```http
561+
HTTP/1.1 200 OK
562+
Content-type: application/json
563+
{
564+
"@odata.context": "https://graph.microsoft.com/beta/$metadata#chats('19%3Ae2ed97baac8e4bffbb91299a38996790%40thread.v2')/messages/$entity",
565+
"@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",
566+
"id": "1727903166936",
567+
"replyToId": null,
568+
"etag": "1727903166936",
569+
"messageType": "message",
570+
"createdDateTime": "2024-10-02T21:06:06.936Z",
571+
"lastModifiedDateTime": "2024-10-02T21:06:06.936Z",
572+
"lastEditedDateTime": null,
573+
"deletedDateTime": null,
574+
"subject": null,
575+
"summary": null,
576+
"chatId": "19:e2ed97baac8e4bffbb91299a38996790@thread.v2",
577+
"importance": "normal",
578+
"locale": "en-us",
579+
"webUrl": null,
580+
"channelIdentity": null,
581+
"onBehalfOf": null,
582+
"policyViolation": null,
583+
"eventDetail": null,
584+
"from": {
585+
"application": null,
586+
"device": null,
587+
"user": {
588+
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
589+
"id": "28c10244-4bad-4fda-993c-f332faef94f0",
590+
"displayName": null,
591+
"userIdentityType": "aadUser",
592+
"tenantId": "2432b57b-0abd-43db-aa7b-16eadd115d34"
593+
}
594+
},
595+
"body": {
596+
"contentType": "html",
597+
"content": "<attachment id=\"1727881360458\"></attachment>"
598+
},
599+
"attachments": [
600+
{
601+
"id": "1727881360458",
602+
"contentType": "forwardedMessageReference",
603+
"contentUrl": null,
604+
"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}}}",
605+
"name": null,
606+
"thumbnailUrl": null,
607+
"teamsAppId": null
608+
}
609+
],
610+
"mentions": [],
611+
"reactions": []
612+
}
613+
```
533614

534615
## Related content
535616

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": "3a5a736c-80cd-4f40-b4dc-d3c3a6ea14c0",
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": "3a5a736c-80cd-4f40-b4dc-d3c3a6ea14c0",
5713+
"Cloud": "Prod",
5714+
"Version": "beta",
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ The get and list operations of the [callRecording](/graph/api/resources/callreco
131131
### Teamwork and communications | Messaging
132132

133133
Use the **firstChannelName** property on [team](/graph/api/resources/team?view=graph-rest-beta&preserve-view=true) to set the name of the first channel created in a team.
134+
[Get](/graph/api/chatmessage-get?view=graph-rest-1.0&preserve-view=true#example-6-get-a-chat-message-with-a-forwarded-message) a chat message that has a forwarded message as an attachment.
134135

135136
## Contribute to Microsoft Graph
136137

0 commit comments

Comments
 (0)