Messages
The Office365 table Messages.
Table Specific Information
Select
You can retrieve all from Messages, specify a Message (Id), UserId, or ParentFolderId, or you can filter results by a certain column:
SELECT * FROM Messages WHERE Id = 'MyMessageId' SELECT * FROM Messages WHERE UserId = 'MyUserId' SELECT * FROM Messages WHERE ParentFolderId = 'MyParentfolderId' SELECT * FROM Messages WHERE ParentFolderId = 'Drafts' SELECT DisplayName, Id FROM Users WHERE DisplayName LIKE 'John%'
Insert
After the INSERT, a new Message will be created in the User's Drafts folder.
INSERT INTO Messages (Subject, Body_Content, UserId) VALUES ('New test Email', 'Test Email created.', 'User Id goes here')
Note: To send the mail, see SendMail.
Update
To update a message:
UPDATE Messages SET Subject = 'Email Updated', Body_Content = 'New Body Content' WHERE Id = 'MyMessageId'
Preserving HTML Formatting
If you are executing an INSERT or UPDATE and your message has HTML in its body_content, you must set body_contentType to 'html'.
UPDATE Messages SET body_content = '<my html document>', body_contentType = 'html'
If you don't set body_contentType to 'html', the HTML content of the message (such as elements and tags) will be visible in the body of the resulting email as plaintext instead of being processed as HTML.
Known Issues
This table may return an inconsistent number of results. That is, it can return a number of rows for one query and a different numbers of rows in subsequent queries, even when your messages remain unchanged. This means that some messages may be missing when querying this table.
This is a known bug in the Microsoft Graph API.
There is a workaround that allows the provider to retrieve all messages, but it comes with a tradeoff: 'events' and 'contacts' data will be returned along with 'messages' data. When using this workaround, you must use filtering to distinguish between message and non-message rows.
To enable this workaround, add "ClientSidePaging=true;" (without quotation marks) in the value of the Other connection property.
Columns
Name | Type | ReadOnly | References | Description |
id [KEY] | String | True |
The id column of the Messages table. | |
Etag | String | False |
The Etag column of the Messages table. | |
categories | String | False |
The categories column of the Messages table. | |
changeKey | String | False |
The changeKey column of the Messages table. | |
createdDateTime | Datetime | False |
The createdDateTime column of the Messages table. | |
lastModifiedDateTime | Datetime | False |
The lastModifiedDateTime column of the Messages table. | |
bccRecipients | String | False |
The bccRecipients column of the Messages table. | |
body_content | String | False |
The body_content column of the Messages table. | |
body_contentType | String | False |
The body_contentType column of the Messages table. | |
bodyPreview | String | False |
The bodyPreview column of the Messages table. | |
ccRecipients | String | False |
The ccRecipients column of the Messages table. | |
conversationId | String | False |
The conversationId column of the Messages table. | |
conversationIndex | Binary | False |
The conversationIndex column of the Messages table. | |
flag_completedDateTime_dateTime | Datetime | False |
The flag_completedDateTime_dateTime column of the Messages table. | |
flag_completedDateTime_timeZone | String | False |
The flag_completedDateTime_timeZone column of the Messages table. | |
flag_flagStatus | String | False |
The flag_flagStatus column of the Messages table. | |
from_emailAddress_address | String | False |
The from_emailAddress_address column of the Messages table. | |
from_emailAddress_name | String | False |
The from_emailAddress_name column of the Messages table. | |
hasAttachments | Bool | False |
The hasAttachments column of the Messages table. | |
importance | String | False |
The importance column of the Messages table. | |
inferenceClassification | String | False |
The inferenceClassification column of the Messages table. | |
internetMessageHeaders | String | False |
The internetMessageHeaders column of the Messages table. | |
internetMessageId | String | False |
The internetMessageId column of the Messages table. | |
isDeliveryReceiptRequested | Bool | False |
The isDeliveryReceiptRequested column of the Messages table. | |
isDraft | Bool | False |
The isDraft column of the Messages table. | |
isRead | Bool | False |
The isRead column of the Messages table. | |
isReadReceiptRequested | Bool | False |
The isReadReceiptRequested column of the Messages table. | |
parentFolderId | String | False |
The parentFolderId column of the Messages table. | |
receivedDateTime | Datetime | False |
The receivedDateTime column of the Messages table. | |
replyTo | String | False |
The replyTo column of the Messages table. | |
sender_emailAddress_address | String | False |
The sender_emailAddress_address column of the Messages table. | |
sender_emailAddress_name | String | False |
The sender_emailAddress_name column of the Messages table. | |
sentDateTime | Datetime | False |
The sentDateTime column of the Messages table. | |
subject | String | False |
The subject column of the Messages table. | |
toRecipients | String | False |
The toRecipients column of the Messages table. | |
uniqueBody_content | String | False |
The uniqueBody_content column of the Messages table. | |
uniqueBody_contentType | String | False |
The uniqueBody_contentType column of the Messages table. | |
webLink | String | False |
The webLink column of the Messages table. | |
UserId | String | False |
The UserId column of the Messages table. | |
IsEventMessage | Bool | False |
he column to distinguish if the messages is with calendar/event invites |