CData Python Connector for Microsoft Teams

Build 26.0.9770

ChannelMessages

Returns messages and replies exchanged within a Microsoft Teams channel.

View-Specific Information

SELECT

The 本製品 uses the Microsoft Teams API to process WHERE clause conditions built with the columns and operator shown below. The rest of the filter is executed client-side within the 本製品.

  • TeamId supports the = operator.
  • ChannelId supports the = operator.
  • Id supports the = operator.

Note: For best performance, specify both TeamId and ChannelId in the WHERE clause.

Example Queries

To retrieve all channel messages:

SELECT * FROM ChannelMessages

To retrieve all messages from a specific team:

SELECT * FROM ChannelMessages WHERE TeamId = '4729c5e5-f923-4435-8a41-44423d42ea79'

To retrieve messages from a specific channel within a team:

SELECT * FROM ChannelMessages WHERE TeamId = '4729c5e5-f923-4435-8a41-44423d42ea79' AND ChannelId = '19:[email protected]'

To retrieve a specific message:

SELECT * FROM ChannelMessages WHERE TeamId = '4729c5e5-f923-4435-8a41-44423d42ea79' AND ChannelId = '19:[email protected]' AND Id = '1688061957561'

キーワード検索

Microsoft Teams API は WHERE 句でのチャンネルメッセージの本文コンテンツによるフィルタリングをサポートしていません。キーワードを含むメッセージを検索するには、SearchMessages ストアドプロシージャを使用してください。このプロシージャは Microsoft Teams Search API を通じてリクエストをルーティングし、ChannelMessages と ChatMessages の両方にわたる結果を返します。

この例では、キーワード「Asteria」を含むすべてのメッセージを検索します:

EXEC SearchMessages Keyword = 'Asteria'

各結果には、完全なメッセージレコードを ChannelMessages と ChatMessages のどちらから取得できるかを示す TableName 列、およびそのルックアップを実行するために必要な Id、TeamId、ChannelId の値が含まれます。

Columns

Name Type Description
Id [KEY] String Unique identifier for the channel message in Microsoft Teams.
BodyContent String Plaintext or rich text content of the message body.
BodyContentType String Specifies the format of the message body content, such as text or HTML.
ChannelId String Identifier of the Microsoft Teams channel where the message was posted.
TeamId String Identifier of the team associated with the channel.
Mentions String List of entities mentioned in the message. Supported entities include user, bot, team, and channel.
Reactions String List of reactions applied to the channel message, such as like or heart.
Attachments String References to objects attached to the message, such as files, tabs, or meetings.
Importance String Priority level of the message, such as normal, high, or urgent.
CreatedDateTime Datetime Timestamp indicating when the message was created.
LastEditedDateTime Datetime Timestamp indicating when the message was last edited.
LastModifiedDateTime Datetime Timestamp indicating when the message was last updated.
DeletedDateTime Datetime Timestamp indicating when the message was deleted, or null if it has not been deleted.
MessageType String Type of message, such as standard or system notification.
ChatId String Identifier of the chat thread when the message is part of a threaded conversation.
Etag String Version identifier for the message used for concurrency control.
FromUserDisplayName String Display name of the user who sent the message.
FromUserId String Unique identifier of the user who sent the message.
FromUserUserIdentityType String Specifies the identity type of the user who sent the message.
FromApplication String Name of the application that sent the message, if applicable.
FromDevice String Name of the device used to send the message, if available.
Locale String Locale setting of the message as defined by the client application, typically en-us.
PolicyViolation String Details about any policy violations associated with the message.
ReplyToId String Identifier of the parent message when the current message is part of a reply thread.
Subject String Subject line of the message in plaintext, if provided.
Summary String Summary text of the message for use in notifications, previews, or fallback views. Applies only to channel messages.
WebUrl String Direct link to view the message in Microsoft Teams.
EventDetail String Details about the event associated with the message, if applicable.

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