Skip to content

Commit 7d8851a

Browse files
authored
Merge branch 'main' into onotpsendcustomextension-update-permissions
2 parents 64e25be + 5ad700e commit 7d8851a

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

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

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,88 @@ Content-type: application/json
619619
"reactions": []
620620
}
621621
```
622+
### Example 6: Get a chat message with a forwarded message
623+
624+
The following example shows a request that gets a chat message with a forwarded message as an attachment.
625+
626+
#### Request
627+
628+
The following example shows a request.
629+
630+
<!-- {
631+
"blockType": "request",
632+
"name": "get_chatmessage_6",
633+
"sampleKeys": ["19:e2ed97baac8e4bffbb91299a38996790@thread.v2", "1727903166936"]
634+
}-->
635+
```msgraph-interactive
636+
GET https://graph.microsoft.com/v1.0/chats/19:e2ed97baac8e4bffbb91299a38996790@thread.v2/messages/1727903166936
637+
```
638+
639+
#### Response
640+
641+
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**.
642+
643+
<!-- {
644+
"blockType": "response",
645+
"truncated": true,
646+
"@odata.type": "microsoft.graph.chatMessage"
647+
} -->
648+
649+
```http
650+
HTTP/1.1 200 OK
651+
Content-type: application/json
652+
653+
{
654+
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#chats('19%3Ae2ed97baac8e4bffbb91299a38996790%40thread.v2')/messages/$entity",
655+
"@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",
656+
"id": "1727903166936",
657+
"replyToId": null,
658+
"etag": "1727903166936",
659+
"messageType": "message",
660+
"createdDateTime": "2024-10-02T21:06:06.936Z",
661+
"lastModifiedDateTime": "2024-10-02T21:06:06.936Z",
662+
"lastEditedDateTime": null,
663+
"deletedDateTime": null,
664+
"subject": null,
665+
"summary": null,
666+
"chatId": "19:e2ed97baac8e4bffbb91299a38996790@thread.v2",
667+
"importance": "normal",
668+
"locale": "en-us",
669+
"webUrl": null,
670+
"channelIdentity": null,
671+
"onBehalfOf": null,
672+
"policyViolation": null,
673+
"eventDetail": null,
674+
"from": {
675+
"application": null,
676+
"device": null,
677+
"user": {
678+
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
679+
"id": "28c10244-4bad-4fda-993c-f332faef94f0",
680+
"displayName": null,
681+
"userIdentityType": "aadUser",
682+
"tenantId": "2432b57b-0abd-43db-aa7b-16eadd115d34"
683+
}
684+
},
685+
"body": {
686+
"contentType": "html",
687+
"content": "<attachment id=\"1727881360458\"></attachment>"
688+
},
689+
"attachments": [
690+
{
691+
"id": "1727881360458",
692+
"contentType": "forwardedMessageReference",
693+
"contentUrl": null,
694+
"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}}}",
695+
"name": null,
696+
"thumbnailUrl": null,
697+
"teamsAppId": null
698+
}
699+
],
700+
"mentions": [],
701+
"reactions": []
702+
}
703+
```
622704

623705
## Related content
624706

0 commit comments

Comments
 (0)