ODBC Driver for Microsoft Teams

Build 26.0.9770

ChatMessages

Returns messages sent and received in Microsoft Teams chat threads.

View-Specific Information

Select

The driver uses the Microsoft Teams API to process WHERE clause conditions built with the following column and operator:

  • ChatId supports the = operator.

The rest of the filter is executed client-side within the driver.

The following is an example query:

SELECT * FROM ChatMessages WHERE ChatId = '19:92dfdfc6-f1d4-4965-9f71-30e4da4fa7fe_e4ea490e-b30c-4b1e-92b0-337117920315@unq.gbl.spaces'

Keyword Search

The Microsoft Teams API does not support filtering chat messages by body content in a WHERE clause. To search for messages containing a keyword, use the SearchMessages stored procedure, which routes the request through the Microsoft Teams Search API and returns results across both ChatMessages and ChannelMessages.

The following example searches for all messages containing the keyword "Asteria":

EXEC SearchMessages Keyword = 'Asteria'

Each result includes a TableName column indicating whether the full message record can be retrieved from ChatMessages or ChannelMessages, along with the Id and ChatId values needed to perform that lookup.

Columns

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

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