Reference

Endpoint Delete Message by Id (Single)


Name

delete_message

Description

Delete message by Id for a specific mailbox and folder

Parameters

Parameter Required Options
Name: MessageId

Label: MessageId

YES
Name: UserId

Label: User ID or Email

The Microsoft Mail user ID GUID or email address for the account to read messages from. (Examples: '4ff54a77-9c09-4274-958f-83bdc0a53900' or 'first.last@domain.com')
YES
Name: MailFolderId

Label: MailFolderId

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Status DT_STR varchar(10) 10
StatusCode DT_I4 int
MessageId DT_STR varchar(255) 255
UserId DT_STR varchar(255) 255
MailFolderId DT_STR varchar(255) 255
ErrorCode DT_WSTR nvarchar(1000) 1000
ErrorMessage DT_WSTR nvarchar(1000) 1000
If the column you are looking for is missing, consider customizing Outlook Mail (Office 365) Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.

Examples

SSIS

Use Outlook Mail (Office 365) Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Source

API Source - Outlook Mail (Office 365)
Outlook Mail Connector (Office 365) can be used to integrate Office 365 Outlook Mail API in your App / BI Tools. You can download attachment, read / search Emails, Users, MailFolders, Send email and more.
Outlook Mail (Office 365)
Delete Message by Id (Single)
Required Parameters
MessageId Fill-in the parameter...
User ID or Email Fill-in the parameter...
Optional Parameters
MailFolderId
Continue processing on 404 error True
ConsumeResponseOnError True
EnableCustomReplace True
SearchFor ^\s*$--regex
ReplaceWith {}
SSIS API Source - Read from table or endpoint

API Destination

API Destination - Outlook Mail (Office 365)
Outlook Mail Connector (Office 365) can be used to integrate Office 365 Outlook Mail API in your App / BI Tools. You can download attachment, read / search Emails, Users, MailFolders, Send email and more.
Outlook Mail (Office 365)
Delete Message by Id (Single)
Required Parameters
MessageId Fill-in the parameter...
User ID or Email Fill-in the parameter...
Optional Parameters
MailFolderId
Continue processing on 404 error True
ConsumeResponseOnError True
EnableCustomReplace True
SearchFor ^\s*$--regex
ReplaceWith {}
SSIS API Destination - Access table or endpoint

ODBC application

Use these SQL queries in your ODBC application data source:

Delete messages by Id

This example shows how to delete a single outlook message by Message Id from a specifid User Id / Mailbox Folder.

SELECT * FROM delete_message
WITH(
	  UserId='me', 
	  --UserId='1487fe8b-f09f-4015-a817-b8b9fe2a3edc', --OR use Id
	  --UserId='myname@company.com', --OR use email

	  MessageId='AAMkADliN2......iS7RK5Ny-I3JFHGAAZRll7aAAA=',
 	  MailFolderId='INBOX', --OR use mailbox ID  
)

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Delete messages by Id

This example shows how to delete a single outlook message by Message Id from a specifid User Id / Mailbox Folder.

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM delete_message
WITH(
	  UserId=''me'', 
	  --UserId=''1487fe8b-f09f-4015-a817-b8b9fe2a3edc'', --OR use Id
	  --UserId=''myname@company.com'', --OR use email

	  MessageId=''AAMkADliN2......iS7RK5Ny-I3JFHGAAZRll7aAAA='',
 	  MailFolderId=''INBOX'', --OR use mailbox ID  
)';

EXEC (@MyQuery) AT [LS_TO_OUTLOOK_MAIL_OFFICE_365_IN_GATEWAY];