|
| 1 | +--- |
| 2 | +title: "chatMessage: replyWithQuote" |
| 3 | +description: "Reply with quote to a single chat message or multiple chat messages in a chat." |
| 4 | +author: "AdityaSharma6" |
| 5 | +ms.subservice: "teams" |
| 6 | +doc_type: apiPageType |
| 7 | +ms.localizationpriority: medium |
| 8 | +ms.date: 02/20/2025 |
| 9 | +--- |
| 10 | + |
| 11 | +# chatMessage: replyWithQuote |
| 12 | + |
| 13 | +Namespace: microsoft.graph |
| 14 | + |
| 15 | +Reply with quote to a single [chat message](../resources/chatmessage.md) or multiple chat messages in a [chat](../resources/chat.md). |
| 16 | + |
| 17 | +> [!NOTE] |
| 18 | +> When replying with a quote to multiple messages, a maximum of 10 messages can be used for the reply. |
| 19 | +
|
| 20 | +[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)] |
| 21 | + |
| 22 | +## Permissions |
| 23 | + |
| 24 | +Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions [only if your app requires it](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference). |
| 25 | + |
| 26 | +<!-- { "blockType": "permissions", "name": "chatmessage_replywithquote" } --> |
| 27 | +[!INCLUDE [permissions-table](../includes/permissions/chatmessage-replywithquote-permissions.md)] |
| 28 | + |
| 29 | +## HTTP request |
| 30 | + |
| 31 | +<!-- { |
| 32 | + "blockType": "ignored" |
| 33 | +} |
| 34 | +--> |
| 35 | +```http |
| 36 | +POST /chats/{chatId}/messages/replyWithQuote |
| 37 | +``` |
| 38 | + |
| 39 | +## Request headers |
| 40 | + |
| 41 | +|Name|Description| |
| 42 | +|:---|:---| |
| 43 | +|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).| |
| 44 | +|Content-Type|application/json. Required.| |
| 45 | + |
| 46 | +## Request body |
| 47 | + |
| 48 | +In the request body, supply a JSON representation of the parameters. |
| 49 | + |
| 50 | +The following table shows the parameters that can be used with this action. |
| 51 | + |
| 52 | +|Parameter|Type|Description| |
| 53 | +|:---|:---|:---| |
| 54 | +|messageIds|String collection|List of message IDs in a chat that are replied to with a quote. | |
| 55 | +|replyMessage|[chatMessage](../resources/chatmessage.md)|The message body for the reply. | |
| 56 | + |
| 57 | +## Response |
| 58 | + |
| 59 | +If successful, this method returns a `201 Created` response code and a new [chatMessage](../resources/chatmessage.md) object in the response body. |
| 60 | + |
| 61 | +## Examples |
| 62 | + |
| 63 | +### Request |
| 64 | + |
| 65 | +The following example shows a request. |
| 66 | + |
| 67 | +<!-- { |
| 68 | + "blockType": "request", |
| 69 | + "name": "chatmessage.replyWithQuote", |
| 70 | + "sampleKeys": ["19:97641583cf154265a237da28ebbde27a@thread.v2"] |
| 71 | +} |
| 72 | +--> |
| 73 | +```http |
| 74 | +POST https://graph.microsoft.com/v1.0/chats/19:97641583cf154265a237da28ebbde27a@thread.v2/messages/replyWithQuote |
| 75 | +Content-Type: application/json |
| 76 | +
|
| 77 | +{ |
| 78 | + "messageIds": [ |
| 79 | + "1728088338580" |
| 80 | + ], |
| 81 | + "replyMessage": { |
| 82 | + "body": { |
| 83 | + "content": "Hello World" |
| 84 | + } |
| 85 | + } |
| 86 | +} |
| 87 | +``` |
| 88 | +--- |
| 89 | + |
| 90 | +### Response |
| 91 | + |
| 92 | +The following example shows the response. |
| 93 | + |
| 94 | +>**Note:** The response object shown here might be shortened for readability. |
| 95 | +<!-- { |
| 96 | + "blockType": "response", |
| 97 | + "truncated": true, |
| 98 | + "@odata.type": "microsoft.graph.chatMessage" |
| 99 | +} |
| 100 | +--> |
| 101 | +```http |
| 102 | +HTTP/1.1 201 Created |
| 103 | +Content-type: application/json |
| 104 | +
|
| 105 | +{ |
| 106 | + "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#chats('19%3A97641583cf154265a237da28ebbde27a%40thread.v2')/messages/$entity", |
| 107 | + "@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", |
| 108 | + "id": "1729091934196", |
| 109 | + "replyToId": null, |
| 110 | + "etag": "1729091934196", |
| 111 | + "messageType": "message", |
| 112 | + "createdDateTime": "2024-10-16T15:18:54.196Z", |
| 113 | + "lastModifiedDateTime": "2024-10-16T15:18:54.196Z", |
| 114 | + "lastEditedDateTime": null, |
| 115 | + "deletedDateTime": null, |
| 116 | + "subject": null, |
| 117 | + "summary": null, |
| 118 | + "chatId": "19:97641583cf154265a237da28ebbde27a@thread.v2", |
| 119 | + "importance": "normal", |
| 120 | + "locale": "en-us", |
| 121 | + "webUrl": null, |
| 122 | + "channelIdentity": null, |
| 123 | + "policyViolation": null, |
| 124 | + "eventDetail": null, |
| 125 | + "from": { |
| 126 | + "application": null, |
| 127 | + "device": null, |
| 128 | + "user": { |
| 129 | + "@odata.type": "#microsoft.graph.teamworkUserIdentity", |
| 130 | + "id": "28c10244-4bad-4fda-993c-f332faef94f0", |
| 131 | + "displayName": "Adele Vance", |
| 132 | + "userIdentityType": "aadUser", |
| 133 | + "tenantId": "2432b57b-0abd-43db-aa7b-16eadd115d34" |
| 134 | + } |
| 135 | + }, |
| 136 | + "body": { |
| 137 | + "contentType": "html", |
| 138 | + "content": "<p></p>\n<attachment id=\"1728422677844\"></attachment>\ntest reply\n<p></p>" |
| 139 | + }, |
| 140 | + "attachments": [ |
| 141 | + { |
| 142 | + "id": "1728422677844", |
| 143 | + "contentType": "messageReference", |
| 144 | + "contentUrl": null, |
| 145 | + "content": "{\"messageId\":\"1728422677844\",\"messagePreview\":\"Hello World Jane Smith\",\"messageSender\":{\"application\":null,\"device\":null,\"user\":{\"userIdentityType\":\"aadUser\",\"tenantId\":\"2432b57b-0abd-43db-aa7b-16eadd115d34\",\"id\":\"28c10244-4bad-4fda-993c-f332faef94f0\",\"displayName\":\"Adele Vance\"}}}", |
| 146 | + "name": null, |
| 147 | + "thumbnailUrl": null, |
| 148 | + "teamsAppId": null |
| 149 | + } |
| 150 | + ], |
| 151 | + "mentions": [], |
| 152 | + "reactions": [] |
| 153 | +} |
| 154 | +``` |
| 155 | + |
0 commit comments