CData Python Connector for Microsoft Teams

Build 26.0.9770

SearchMessages

Searches for Teams channel messages and chat messages containing a keyword, using the Microsoft Graph Search API. Returns a subset of fields for each matching message.

Input

Name Type Required Description
Keyword String True The keyword or phrase to search for in Teams message bodies and attachment content. The search is full-text and is not equivalent to SQL LIKE pattern matching. SQL wildcard characters such as % have no special meaning and are treated as literal characters. For example: Asteria.
MaxRows String False Maximum number of results to return across all pages. Set to 0 or leave unset to return all available results. For example, set to 100 to limit results to 100 messages.

Result Set Columns

Name Type Description
TableName String The recommended table for looking up the full message record. Returns ChannelMessages when both TeamId and ChannelId are populated, otherwise ChatMessages. In rare cases such as meeting chat messages, a result labeled ChannelMessages may only be findable in ChatMessages. If the record is not found in the suggested table, query ChatMessages using the ChatId value.
Id String Unique identifier for the message in Microsoft Teams.
BodyContent String Search result preview excerpt of the message. The keyword may not appear directly in this excerpt if the match occurred in an attachment or a different portion of the message body.
TeamId String Identifier of the team. Populated for channel messages; empty for chat messages.
ChannelId String Identifier of the channel. Populated for channel messages; empty for chat messages.
ChatId String Identifier of the chat thread. Always use this value to look up the message in ChatMessages if the record is not found using TeamId and ChannelId.
Subject String Subject line of the message, if provided.
Importance String Priority level of the message, such as normal, high, or urgent.
CreatedDateTime String Timestamp indicating when the message was created.
LastModifiedDateTime String Timestamp indicating when the message was last modified.
FromUserDisplayName String Display name of the message sender.
WebUrl String Direct link to view the message in Microsoft Teams.
Etag String Version identifier for the message used for concurrency control.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9770