Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
Namespace: microsoft.graph
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
List all the replies to a message in a channel of a team or in a chat.
This method lists only the replies of the specified message, if any. To get the message itself, call Get chatMessage.
Note: This API supports subscribing to changes (create, update, and delete) using change notifications. This allows callers to subscribe and get changes in real time. For details, see Get notifications for messages.
This API is available in the following national cloud deployments.
| Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ |
Permissions
The following tables show the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permissions for channel replies
| Permission type | Least privileged permissions | Higher privileged permissions |
|---|---|---|
| Delegated (work or school account) | ChannelMessage.Read.All | Group.Read.All, Group.ReadWrite.All |
| Delegated (personal Microsoft account) | Not supported. | Not supported. |
| Application | ChannelMessage.Read.Group | ChannelMessage.Read.All, Group.Read.All, Group.ReadWrite.All |
Note
The ChannelMessage.Read.Group and ChatMessage.Read.Chat permissions use resource-specific consent.
Permissions for chat replies
| Permission type | Least privileged permissions | Higher privileged permissions |
|---|---|---|
| Delegated (work or school account) | Chat.Read | Chat.ReadWrite |
| Delegated (personal Microsoft account) | Not supported. | Not supported. |
| Application | ChatMessage.Read.Chat | Chat.Read.All, Chat.ReadWrite.All, ChatMessage.Read.All |
HTTP request
GET /teams/{team-id}/channels/{channel-id}/messages/{message-id}/replies
List replies to a message in a chat
GET /chats/{chat-id}/messages/{message-id}/replies
Use the id of the root message as {message-id}.
Note
Chat reply endpoints are currently supported only for bot sessions (bot conversations).
Optional query parameters
For channel message replies: You can use the $top query parameter to control the number of items per response. Maximum allowed $top value is 50. The other OData query parameters aren't currently supported for channel message replies.
For chat replies: This method supports $select, $top, and $skipToken. The maximum value of $top is 50. For general information, see OData query parameters.
If the response includes @odata.nextLink, use the entire URL to request the next page. Don't construct or modify the skip token. Continue following @odata.nextLink until it's absent, even when an intermediate page has an empty value array.
Request headers
| Header | Value |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK response code and a collection of chatmessage objects in the response body.
Examples
Example 1: List replies to a message in a channel
The following example shows how to list replies to a message in a channel. The specified message has three replies.
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/teams/fbe2bf47-16c8-47cf-b4a5-4b9b187c508b/channels/19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2/messages/1616989510408/replies
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#teams('fbe2bf47-16c8-47cf-b4a5-4b9b187c508b')/channels('19%3A4a95f7d8db4c4e7fae857bcebe0623e6%40thread.tacv2')/messages('1616989510408')/replies",
"@odata.count": 3,
"value": [
{
"id": "1616989753153",
"replyToId": "1616989510408",
"etag": "1616989753153",
"messageType": "message",
"createdDateTime": "2021-03-29T03:49:13.153Z",
"lastModifiedDateTime": "2021-03-29T03:49:13.153Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"chatId": null,
"importance": "normal",
"locale": "en-us",
"webUrl": "https://teams.microsoft.com/l/message/19%3A4a95f7d8db4c4e7fae857bcebe0623e6%40thread.tacv2/1616989753153?groupId=fbe2bf47-16c8-47cf-b4a5-4b9b187c508b&tenantId=2432b57b-0abd-43db-aa7b-16eadd115d34&createdTime=1616989753153&parentMessageId=1616989510408",
"policyViolation": null,
"eventDetail": null,
"from": {
"application": null,
"device": null,
"user": {
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
"id": "8ea0e38b-efb3-4757-924a-5f94061cf8c2",
"displayName": "Robin Kline",
"userIdentityType": "aadUser",
"tenantId": "e61ef81e-8bd8-476a-92e8-4a62f8426fca"
}
},
"body": {
"contentType": "text",
"messageBodyContentType": "text",
"content": "Reply3"
},
"channelIdentity": {
"teamId": "fbe2bf47-16c8-47cf-b4a5-4b9b187c508b",
"channelId": "19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2"
},
"onBehalfOf": null,
"attachments": [],
"mentions": [],
"reactions": [],
"messageHistory": []
},
{
"id": "1616989750004",
"replyToId": "1616989510408",
"etag": "1616989750004",
"messageType": "message",
"createdDateTime": "2021-03-29T03:49:10.004Z",
"lastModifiedDateTime": "2021-03-29T03:49:10.004Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"chatId": null,
"importance": "normal",
"locale": "en-us",
"webUrl": "https://teams.microsoft.com/l/message/19%3A4a95f7d8db4c4e7fae857bcebe0623e6%40thread.tacv2/1616989750004?groupId=fbe2bf47-16c8-47cf-b4a5-4b9b187c508b&tenantId=2432b57b-0abd-43db-aa7b-16eadd115d34&createdTime=1616989750004&parentMessageId=1616989510408",
"policyViolation": null,
"eventDetail": null,
"from": {
"application": null,
"device": null,
"user": {
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
"id": "8ea0e38b-efb3-4757-924a-5f94061cf8c2",
"displayName": "Robin Kline",
"userIdentityType": "aadUser",
"tenantId": "e61ef81e-8bd8-476a-92e8-4a62f8426fca"
}
},
"body": {
"contentType": "text",
"messageBodyContentType": "text",
"content": "Reply2"
},
"channelIdentity": {
"teamId": "fbe2bf47-16c8-47cf-b4a5-4b9b187c508b",
"channelId": "19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2"
},
"onBehalfOf": null,
"attachments": [],
"mentions": [],
"reactions": [],
"messageHistory": []
},
{
"id": "1616989747416",
"replyToId": "1616989510408",
"etag": "1616989747416",
"messageType": "message",
"createdDateTime": "2021-03-29T03:49:07.416Z",
"lastModifiedDateTime": "2021-03-29T03:49:07.416Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"chatId": null,
"importance": "normal",
"locale": "en-us",
"webUrl": "https://teams.microsoft.com/l/message/19%3A4a95f7d8db4c4e7fae857bcebe0623e6%40thread.tacv2/1616989747416?groupId=fbe2bf47-16c8-47cf-b4a5-4b9b187c508b&tenantId=2432b57b-0abd-43db-aa7b-16eadd115d34&createdTime=1616989747416&parentMessageId=1616989510408",
"policyViolation": null,
"eventDetail": null,
"from": {
"application": null,
"device": null,
"user": {
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
"id": "8ea0e38b-efb3-4757-924a-5f94061cf8c2",
"displayName": "Robin Kline",
"userIdentityType": "aadUser",
"tenantId": "e61ef81e-8bd8-476a-92e8-4a62f8426fca"
}
},
"body": {
"contentType": "text",
"messageBodyContentType": "text",
"content": "Reply1"
},
"channelIdentity": {
"teamId": "fbe2bf47-16c8-47cf-b4a5-4b9b187c508b",
"channelId": "19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2"
},
"onBehalfOf": null,
"attachments": [],
"mentions": [],
"reactions": [],
"messageHistory": []
}
]
}
Example 2: List replies and select their content
The following example shows how to list one reply per page and selects its ID, root message ID, and body.
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/chats/19:8b13f6c95f8b4e39a2e79fce14f205a1@thread.v2/messages/1757077200000/replies?$top=1&$select=id,replyToId,body
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(chatMessage)",
"@odata.nextLink": "https://graph.microsoft.com/beta/chats/19:8b13f6c95f8b4e39a2e79fce14f205a1@thread.v2/messages/1757077200000/replies?$top=1&$select=id,replyToId,body&$skiptoken=eyJvZmZzZXQiOjF9",
"value": [
{
"id": "1757077260000",
"replyToId": "1757077200000",
"body": {
"contentType": "text",
"content": "The deployment is ready for review."
}
}
]
}
Example 3: Continue paging after an empty page
The following example shows how to request the next page by using the complete @odata.nextLink from the preceding response.
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/chats/19:8b13f6c95f8b4e39a2e79fce14f205a1@thread.v2/messages/1757077200000/replies?$top=1&$select=id,replyToId,body&$skiptoken=eyJvZmZzZXQiOjF9
Response
The following response has an empty value array and another @odata.nextLink. Request that URL to continue retrieving replies.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(chatMessage)",
"@odata.nextLink": "https://graph.microsoft.com/beta/chats/19:8b13f6c95f8b4e39a2e79fce14f205a1@thread.v2/messages/1757077200000/replies?$top=1&$select=id,replyToId,body&$skiptoken=eyJvZmZzZXQiOjJ9",
"value": []
}