Skip to main content

teams chat message list

Lists all messages from a Microsoft Teams chat conversation.

Usage

m365 teams chat message list [options]

Options

-i, --chatId <chatId>

The ID of the chat conversation.

--endDateTime [endDateTime]

Time indicating the exclusive end of a time range when the message was created.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, permissions, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Permissions

ResourcePermissions
Microsoft GraphChatMessage.Read

Examples

List the messages from a Microsoft Teams chat conversation

m365 teams chat message list --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2

List messages from a Microsoft Teams chat conversation created before November 1, 2022

m365 teams chat message list --chatId 19:2da4c29f6d7041eca70b638b43d45437@thread.v2 --endDateTime 2022-11-01T00:00:00Z

Response

[
{
"id": "1667653590582",
"replyToId": null,
"etag": "1667653590582",
"messageType": "message",
"createdDateTime": "2022-11-05T13:06:30.582Z",
"lastModifiedDateTime": "2022-11-05T13:06:30.582Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"chatId": "19:2da4c29f6d7041eca70b638b43d45437@thread.v2",
"importance": "normal",
"locale": "en-us",
"webUrl": null,
"channelIdentity": null,
"policyViolation": null,
"eventDetail": null,
"from": {
"application": null,
"device": null,
"user": {
"id": "78ccf530-bbf0-47e4-aae6-da5f8c6fb142",
"displayName": "John Doe",
"userIdentityType": "aadUser",
"tenantId": "446355e4-e7e3-43d5-82f8-d7ad8272d55b"
}
},
"body": {
"contentType": "html",
"content": "<p>Hello world</p>"
},
"attachments": [],
"mentions": [],
"reactions": []
}
]