Endpoint Get Message Attachments (With search condition)
Name
get_message_attachments
Description
Lists the message attachments for the specified search criterial and user id
Parameters
| Parameter | Required | Options | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Name:
Label: Search Expression Expression to return messages matching the specified query. Supports the same query format as the Gmail search box. |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Name:
Label: IncludeSpamTrash Include messages from SPAM and TRASH in the results. |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Name:
Label: LabelIds Only return messages with labels that match all of the specified label IDs. Messages in a thread might have labels that other messages in the same thread don't have. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Name:
Label: MaxResults Maximum number of messages to return. This field defaults to 100. The maximum allowed value for this field is 500. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Name:
Label: ApiVersion The version of the API to use. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Name:
Label: UserId Enter the Gmail user ID. |
|
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| MessageId |
DT_WSTR
|
nvarchar(50)
|
50 | |
| PartId |
DT_WSTR
|
nvarchar(50)
|
50 | |
| AttachmentId |
DT_WSTR
|
nvarchar(1000)
|
1000 | |
| MimeType |
DT_WSTR
|
nvarchar(200)
|
200 | |
| Filename |
DT_WSTR
|
nvarchar(108)
|
108 | |
| Headers |
DT_WSTR
|
nvarchar(2000)
|
2000 | |
| AttachmentSize |
DT_I8
|
bigint
|
||
| PayloadMimeType |
DT_WSTR
|
nvarchar(200)
|
200 | |
| ThreadId |
DT_WSTR
|
nvarchar(50)
|
50 | |
| MessageSnippet |
DT_WSTR
|
nvarchar(1000)
|
1000 | |
| MessageSizeEstimate |
DT_I8
|
bigint
|
||
| HistoryId |
DT_WSTR
|
nvarchar(50)
|
50 | |
| InternalDate |
DT_WSTR
|
nvarchar(50)
|
50 |
If the column you are looking for is missing, consider customizing Gmail 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 Gmail Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
API Source - Gmail
Read / search Gmail messages, download attachments, send mail and more using Gmail REST API.
Gmail
Get Message Attachments (With search condition)
| There are no parameters to configure. |
API Destination
API Destination - Gmail
Read / search Gmail messages, download attachments, send mail and more using Gmail REST API.
Gmail
Get Message Attachments (With search condition)
| There are no parameters to configure. |
ODBC application
Use these SQL queries in your ODBC application data source:
Get Gmail message attchments
This example shows how to search messages using search condition and list all attchments.
SELECT *
FROM get_message_attachments
WITH(
--Search='after:<<yearstart+1d|~|yyyy/MM/dd,FUN_TO_DATE>> before:<<today-1d|~|yyyy/MM/dd,FUN_TO_DATE>>'
Search='subject:(daily report)'
)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Get Gmail message attchments
This example shows how to search messages using search condition and list all attchments.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM get_message_attachments
WITH(
--Search=''after:<<yearstart+1d|~|yyyy/MM/dd,FUN_TO_DATE>> before:<<today-1d|~|yyyy/MM/dd,FUN_TO_DATE>>''
Search=''subject:(daily report)''
)';
EXEC (@MyQuery) AT [LS_TO_GMAIL_IN_GATEWAY];