Skip to content

Commit 63d0247

Browse files
authored
Merge pull request #26103 from microsoftgraph/users/sumanac/loopcomponentforbeta
Users/sumanac/loopcomponentforbeta
2 parents ad66688 + ebcd7fb commit 63d0247

File tree

5 files changed

+148
-4
lines changed

5 files changed

+148
-4
lines changed

api-reference/beta/api/chatmessage-get.md

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Don't supply a request body for this method.
7373

7474
## Response
7575

76-
If successful, this method returns a `200 OK` response code and a [chatmessage](../resources/chatmessage.md) object in the response body.
76+
If successful, this method returns a `200 OK` response code and a [chatMessage](../resources/chatmessage.md) object in the response body.
7777

7878
## Examples
7979

@@ -589,7 +589,7 @@ GET https://graph.microsoft.com/beta/chats/19:80a7ff67c0ef43c19d88a7638be436b1@t
589589

590590
#### Response
591591

592-
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.
592+
The following example shows the response. The message body contains `<at></at>` tags for each @mention of everyone in a group chat. The **conversationIdentityType** property is set to `chat` in the **conversation** identity of the **mentioned** object.
593593

594594
<!-- {
595595
"blockType": "response",
@@ -777,6 +777,102 @@ Content-type: application/json
777777
}
778778
```
779779

780+
### Example 7: Get a chat message with a Microsoft Loop component
781+
782+
The following example shows a request that gets a chat message that has a Loop component as two attachments.
783+
784+
#### Request
785+
786+
The following example shows a request.
787+
788+
<!-- {
789+
"blockType": "request",
790+
"name": "get_chatmessage_7",
791+
"sampleKeys": ["19:e2ed97baac8e4bffbb91299a38996790@thread.v2", "1732043970539"]
792+
}-->
793+
```msgraph-interactive
794+
GET https://graph.microsoft.com/beta/chats/19:e2ed97baac8e4bffbb91299a38996790@thread.v2/messages/1732043970539
795+
```
796+
797+
798+
799+
#### Response
800+
801+
The following example shows the response. The message body contains two attachments. The value of the **contentType** property of the Loop component is `application/vnd.microsoft.card.fluidEmbedCard`, and the value of the **contentType** property of the placeholder card is `application/vnd.microsoft.card.codesnippet`.
802+
803+
> **Note** - The **contentUrl** and **content** properties for a placeholder card don't have values.
804+
805+
<!-- {
806+
"blockType": "response",
807+
"truncated": true,
808+
"@odata.type": "microsoft.graph.chatMessage"
809+
} -->
810+
811+
```http
812+
HTTP/1.1 200 OK
813+
Content-type: application/json
814+
815+
{
816+
"@odata.context": "https://graph.microsoft.com/beta/$metadata#chats('19%3Ae2ed97baac8e4bffbb91299a38996790%40thread.v2')/messages/$entity",
817+
"@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",
818+
"id": "1732043970539",
819+
"replyToId": null,
820+
"etag": "1732043970539",
821+
"messageType": "message",
822+
"createdDateTime": "2024-11-19T19:19:30.539Z",
823+
"lastModifiedDateTime": "2024-11-19T19:19:30.539Z",
824+
"lastEditedDateTime": null,
825+
"deletedDateTime": null,
826+
"subject": null,
827+
"summary": null,
828+
"chatId": "19:e2ed97baac8e4bffbb91299a38996790@thread.v2",
829+
"importance": "normal",
830+
"locale": "en-us",
831+
"webUrl": null,
832+
"channelIdentity": null,
833+
"onBehalfOf": null,
834+
"policyViolation": null,
835+
"eventDetail": null,
836+
"from": {
837+
"application": null,
838+
"device": null,
839+
"user": {
840+
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
841+
"id": "28c10244-4bad-4fda-993c-f332faef94f0",
842+
"displayName": null,
843+
"userIdentityType": "aadUser",
844+
"tenantId": "2432b57b-0abd-43db-aa7b-16eadd115d34"
845+
}
846+
},
847+
"body": {
848+
"contentType": "html",
849+
"content": "<attachment id=\"placeholderCard\"></attachment><span style=\"display:none\"></span><attachment id=\"b21e256a-8581-45cf-ae05-8bb998360bcc\"></attachment>"
850+
},
851+
"attachments": [
852+
{
853+
"id": "b21e256a-8581-45cf-ae05-8bb998360bcc",
854+
"contentType": "application/vnd.microsoft.card.fluidEmbedCard",
855+
"contentUrl": null,
856+
"content": "{\r\n \"componentUrl\": \"https://teamsgraph-my.sharepoint.com/:fl:/g/personal/sumanac_teamsgraph_onmicrosoft_com/EQnofOQM0MpOoDaRIvw-pS8Bfsj_WDFuanBBXnjDAD-w3g?nav=cz0lMkZwZXJzb25hbCUyRnN1bWFuYWNfdGVhbXNncmFwaF9vbm1pY3Jvc29mdF9jb20mZD1iIWVUcmxYX19jN2t5eW9GSFhJdG8yTDI4bmtnV2EtOXhEa244SVBOdGZFYnlxandPblkwdE9TcFVldkh6dWtBV1ImZj0wMUU2TzQ0WFlKNUI2T0lER1FaSkhLQU5VUkVMNkQ1SkpQJmM9JTJGJmZsdWlkPTEmYT1UZWFtcyZwPSU0MGZsdWlkeCUyRmxvb3AtcGFnZS1jb250YWluZXI%3D\",\r\n \"sourceType\": \"Compose\"\r\n}",
857+
"name": null,
858+
"thumbnailUrl": null,
859+
"teamsAppId": "FluidEmbedCard"
860+
},
861+
{
862+
"id": "placeholderCard",
863+
"contentType": "application/vnd.microsoft.card.codesnippet",
864+
"contentUrl": null,
865+
"content": "{}",
866+
"name": null,
867+
"thumbnailUrl": null,
868+
"teamsAppId": "FLUID_PLACEHOLDER_CARD"
869+
}
870+
],
871+
"mentions": [],
872+
"reactions": []
873+
}
874+
```
875+
780876
## Related content
781877

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

api-reference/beta/resources/chatmessageattachment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ An entity of type **chatMessageAttachment** is returned as part of the [Get chan
2222
| Property | Type |Description|
2323
|:---------------|:--------|:----------|
2424
|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.|
25-
|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>|
25+
|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`: Either a code snippet or place holder. </li><li>`application/vnd.microsoft.card.announcement`: An announcement header. </li><li>`application/vnd.microsoft.card.fluidEmbedCard`: A Microsoft Loop component. </li>|
2626
|contentUrl|string|The URL for the content of the attachment. |
2727
|id|string| Read-only. The unique ID of the attachment.|
2828
|name|string|Name of the attachment.|

changelog/Microsoft.Teams.Core.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5733,6 +5733,24 @@
57335733
"CreatedDateTime": "2025-01-14T18:15:55.2254479Z",
57345734
"WorkloadArea": "Teamwork and communications",
57355735
"SubArea": "Messaging"
5736+
},
5737+
{
5738+
"ChangeList": [
5739+
{
5740+
"Id": "5dcb0d48-8790-4447-acc0-c7018569adf5",
5741+
"ApiChange": "Property",
5742+
"ChangedApiName": "contentType",
5743+
"ChangeType": "Change",
5744+
"Description": "Added Microsoft Loop components as two types of attachments, a Loop component and a place holder. New **contentType** properties `application/vnd.microsoft.card.fluidEmbedCard` and `application/vnd.microsoft.card.codesnippet` are in the [chatMessageAttachment](https://learn.microsoft.com/en-us/graph/api/resources/chatmessageattachment?view=graph-rest-1.0) resource.",
5745+
"Target": "chatMessageAttachment"
5746+
}
5747+
],
5748+
"Id": "5dcb0d48-8790-4447-acc0-c7018569adf5",
5749+
"Cloud": "Prod",
5750+
"Version": "v1.0",
5751+
"CreatedDateTime": "2025-01-14T18:15:55.2254479Z",
5752+
"WorkloadArea": "Teamwork and communications",
5753+
"SubArea": "Messaging"
57365754
}
57375755
]
57385756
}

concepts/teams-messaging-overview.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ The [chatMessageAttachment](/graph/api/resources/chatmessageattachment) resource
2727

2828
Cards represent visual elements backed by a predefined schema. Teams supports the cards defined by the [Bot Framework](/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0&preserve-view=true#attachment-object) in addition to the following card types:
2929

30-
- Code snippet - Set **contentType** to `application/vnd.microsoft.card.codesnippet`
30+
- Code snippet or place holder - Set **contentType** to `application/vnd.microsoft.card.codesnippet`
3131
- Announcement card - Set **contentType** set to `application/vnd.microsoft.card.announcement`
32+
- Microsoft Loop component card - Set **contentType** set to `application/vnd.microsoft.card.fluidEmbedCard`
3233

3334
For cards, the **contentType** property is set to the type of card, and the **content** property contains the serialized json for the card.
3435

@@ -70,6 +71,31 @@ The following example shows the schema for an adaptive card attachment when the
7071

7172
> **Note:** Microsoft Graph only supports cards that have the **OpenUrl** action set. Other actions like **ShowCard** aren't supported. Microsoft Graph does allow messages posted by bots that have other actions in them to be read.
7273
74+
The following example shows the schema for a Loop component as two attachments.
75+
76+
```json
77+
"attachments": [
78+
{
79+
"id": "b21e256a-8581-45cf-ae05-8bb998360bcc",
80+
"contentType": "application/vnd.microsoft.card.fluidEmbedCard",
81+
"contentUrl": null,
82+
"content": "{\r\n \"componentUrl\": \"https://teamsgraph-my.sharepoint.com/:fl:/g/personal/sumanac_teamsgraph_onmicrosoft_com/EQnofOQM0MpOoDaRIvw-pS8Bfsj_WDFuanBBXnjDAD-w3g?nav=cz0lMkZwZXJzb25hbCUyRnN1bWFuYWNfdGVhbXNncmFwaF9vbm1pY3Jvc29mdF9jb20mZD1iIWVUcmxYX19jN2t5eW9GSFhJdG8yTDI4bmtnV2EtOXhEa244SVBOdGZFYnlxandPblkwdE9TcFVldkh6dWtBV1ImZj0wMUU2TzQ0WFlKNUI2T0lER1FaSkhLQU5VUkVMNkQ1SkpQJmM9JTJGJmZsdWlkPTEmYT1UZWFtcyZwPSU0MGZsdWlkeCUyRmxvb3AtcGFnZS1jb250YWluZXI%3D\",\r\n \"sourceType\": \"Compose\"\r\n}",
83+
"name": null,
84+
"thumbnailUrl": null,
85+
"teamsAppId": "FluidEmbedCard"
86+
},
87+
{
88+
"id": "placeholderCard",
89+
"contentType": "application/vnd.microsoft.card.codesnippet",
90+
"contentUrl": null,
91+
"content": "{}",
92+
"name": null,
93+
"thumbnailUrl": null,
94+
"teamsAppId": "FLUID_PLACEHOLDER_CARD"
95+
}
96+
],
97+
```
98+
7399
#### file attachment
74100

75101
When an [attachment](/graph/api/resources/chatmessageattachment) object refers to a file, it contains information about the file, including the link to open the file. The file itself is located in an accessible store like SharePoint. When a **chatMessage** has an attachment of type file, the value of the **contentType** property on the [attachment](/graph/api/resources/chatmessageattachment) resource is set to `reference`, and the **contentUrl** property contains the file URL.

concepts/whats-new-overview.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ Use the new mailbox import and export APIs in Microsoft Graph to build solutions
8080

8181
Use the [teamsChannel](/graph/api/resources/planner-overview?view=graph-rest-beta&preserve-view=true#container-type-teams-channel) container type to create plans in shared channels in Microsoft Teams.
8282

83+
### Teamwork and communications | Messaging
84+
85+
- [Get](/graph/api/chatmessage-get#example-7-get-a-chat-message-with-a-loop-component) a chat message that includes a Microsoft Loop component as two attachments.
86+
8387
## December 2024: New and generally available
8488

8589
### Reports

0 commit comments

Comments
 (0)