Edit

Share via


chatMessage: replyWithQuote

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.

Reply with quote to a single chat message or multiple chat messages in a chat.

Note

When replying with a quote to multiple messages, a maximum of 10 messages can be used for the reply.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

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. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) ChatMessage.Send Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Not supported. Not supported.

HTTP request

POST /chats/{chatId}/messages/replyWithQuote

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the parameters.

The following table shows the parameters that can be used with this action.

Parameter Type Description
messageIds String collection List of message IDs in a chat that are replied to with a quote.
replyMessage chatMessage The message body for the reply.

Response

If successful, this method returns a 201 Created response code and a new chatMessage object in the response body.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/chats/19:[email protected]/messages/replyWithQuote
Content-Type: application/json

{
  "messageIds": [
    "1728088338580"
  ],
  "replyMessage": {
    "body": {
      "content": "Hello World"
    }
  }
}

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 201 Created
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#chats('19%3A97641583cf154265a237da28ebbde27a%40thread.v2')/messages/$entity",
  "@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",
  "id": "1729091934196",
  "replyToId": null,
  "etag": "1729091934196",
  "messageType": "message",
  "createdDateTime": "2024-10-16T15:18:54.196Z",
  "lastModifiedDateTime": "2024-10-16T15:18:54.196Z",
  "lastEditedDateTime": null,
  "deletedDateTime": null,
  "subject": null,
  "summary": null,
  "chatId": "19:[email protected]",
  "importance": "normal",
  "locale": "en-us",
  "webUrl": null,
  "channelIdentity": null,
  "policyViolation": null,
  "eventDetail": null,
  "from": {
    "application": null,
    "device": null,
    "user": {
      "@odata.type": "#microsoft.graph.teamworkUserIdentity",
      "id": "28c10244-4bad-4fda-993c-f332faef94f0",
      "displayName": "Adele Vance",
      "userIdentityType": "aadUser",
      "tenantId": "2432b57b-0abd-43db-aa7b-16eadd115d34"
    }
  },
  "body": {
    "contentType": "html",
    "content": "<p></p>\n<attachment id=\"1728422677844\"></attachment>\ntest reply\n<p></p>"
  },
  "attachments": [
    {
      "id": "1728422677844",
      "contentType": "messageReference",
      "contentUrl": null,
      "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\"}}}",
      "name": null,
      "thumbnailUrl": null,
      "teamsAppId": null
    }
  ],
  "mentions": [],
  "reactions": []
}