EndPoint Download Message Attachment (Single File)
Name
download_message_attachment
Description
Download a specific attachment linked to the specified message Id. [API reference]
Parameters
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description |
---|---|---|---|---|---|
Data |
DT_NTEXT
|
nvarchar(MAX)
|
False |
||
Status |
DT_STR
|
varchar(4000)
|
4000 | False |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | 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 component to read data or in API Destination component to read/write data:
Download Message Attachment (Single File) using API Source
Outlook Mail (Office 365)
Download Message Attachment (Single File)

Download Message Attachment (Single File) using API Destination
Outlook Mail (Office 365)
Download Message Attachment (Single File)

ODBC application
Use these SQL queries in your ODBC application data source:
Download the specified attachment by message ID and attachment ID and save it to a file
SELECT * FROM download_message_attachment
WITH (MessageId='AAMkADIwNz2hODMyLTZiMTQtNDhiMC04OWQzLTc5YTY5M2IyMjk0NABGZAAAAxCbj2hVuNphT74wylrfU4ixBwAbUV6IxRnpQ6qzrb2WfacdAAAAAAEMAAAbUb6IxRnpQrqzrb2WfacdAAAysBnxAAA=',
AttachmentId='AAMkADIwNzNhODMyLTZiMTQtNDhiMC04cWQzLTc5YTY5M2IyMjk0NABGAAAAAACbj2hVuNphTZ4wylrfU4ixBwAbUV6IxRnpQrqzrb2WfacdAAAAAAEMAA8bUV6IxRnpQrqzrb2WfacdAAAysBnxAAABEgAQAK6dg4NuEa5Fmn_5Tp_D_XM=',
TargetFilePath='C:\temp\photo.png'
)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Download the specified attachment by message ID and attachment ID and save it to a file
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM download_message_attachment
WITH (MessageId=''AAMkADIwNz2hODMyLTZiMTQtNDhiMC04OWQzLTc5YTY5M2IyMjk0NABGZAAAAxCbj2hVuNphT74wylrfU4ixBwAbUV6IxRnpQ6qzrb2WfacdAAAAAAEMAAAbUb6IxRnpQrqzrb2WfacdAAAysBnxAAA='',
AttachmentId=''AAMkADIwNzNhODMyLTZiMTQtNDhiMC04cWQzLTc5YTY5M2IyMjk0NABGAAAAAACbj2hVuNphTZ4wylrfU4ixBwAbUV6IxRnpQrqzrb2WfacdAAAAAAEMAA8bUV6IxRnpQrqzrb2WfacdAAAysBnxAAABEgAQAK6dg4NuEa5Fmn_5Tp_D_XM='',
TargetFilePath=''C:\temp\photo.png''
)';
EXEC (@MyQuery) AT [LINKED_SERVER_TO_OUTLOOK_MAIL_OFFICE_365_IN_DATA_GATEWAY];