Reference

Endpoint Download Multiple Attachments


Name

download_attachments

Description

Download Multiple Attachments for a specified parent.There are three possible parent values for this request: project, project_brief, and task. For a project, an attachment refers to a file uploaded to the [Key resources] section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task. Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to GET /attachments for a task will return all of the images in the task, including inline images.

Parameters

Parameter Required Options
Name: ParentId

Label: Parent Id (e.g. Id of Project, Task or ProjectBrief)

Globally unique identifier for object to fetch statuses from. Must be a GID for a project, project_brief, or task.
YES
Name: OverwriteFile

Label: OverwriteFile

YES
Option Value
True True
False False
Name: SaveFolder

Label: SaveFolder

Specify a disk folder path to save file(s) to
YES
Name: Fields

Label: Fields

Option Value
name name
resource_subtype resource_subtype
connected_to_app connected_to_app
created_at created_at
download_url download_url
host host
parent parent
parent.name parent.name
parent.resource_subtype parent.resource_subtype
permanent_url permanent_url
size size
view_url view_url
Name: Limit

Label: Limit

Results per page. The number of objects to return per page. The value must be between 1 and 100.

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
StatusCode DT_I4 int
SavedFilePath DT_WSTR nvarchar(300) 300
SavedBytes DT_I8 bigint
Id DT_WSTR nvarchar(50) 50
Name DT_WSTR nvarchar(255) 255
ResourceSubtype DT_WSTR nvarchar(50) 50
ConnectedToApp DT_BOOL bit
CreatedAt DT_DBTIMESTAMP datetime
DownloadUrl DT_WSTR nvarchar(500) 500
Host DT_WSTR nvarchar(50) 50
ParentId DT_WSTR nvarchar(50) 50
ParentName DT_WSTR nvarchar(255) 255
ParentResourceSubtype DT_WSTR nvarchar(50) 50
PermanentUrl DT_WSTR nvarchar(500) 500
Size DT_I4 int
ViewUrl DT_WSTR nvarchar(500) 500
If the column you are looking for is missing, consider customizing Asana 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 Asana Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Source

API Source - Asana
Read and write Asana data effortlessly. Integrate, manage, and automate tasks, projects, workspaces, and time entries — almost no coding required.
Asana
Download Multiple Attachments
Required Parameters
Parent Id (e.g. Id of Project, Task or ProjectBrief) Fill-in the parameter...
OverwriteFile Fill-in the parameter...
SaveFolder Fill-in the parameter...
Optional Parameters
Fields
Continue On 404 Error (When record not found) False
SSIS API Source - Read from table or endpoint

API Destination

API Destination - Asana
Read and write Asana data effortlessly. Integrate, manage, and automate tasks, projects, workspaces, and time entries — almost no coding required.
Asana
Download Multiple Attachments
Required Parameters
Parent Id (e.g. Id of Project, Task or ProjectBrief) Fill-in the parameter...
OverwriteFile Fill-in the parameter...
SaveFolder Fill-in the parameter...
Optional Parameters
Fields
Continue On 404 Error (When record not found) False
SSIS API Destination - Access table or endpoint

ODBC application

Use these SQL queries in your ODBC application data source:

Download multiple attachments to local disk

<p>Downloads all attachments for a parent (task, project, or project brief) to a folder. Specify the parent ID and the folder path; saved file names include the attachment ID and original file name. You can choose whether to overwrite existing files. For tasks, this includes inline images in the description; for projects, files in the Key resources section; for project briefs, inline files in the brief.</p>

SELECT * FROM download_attachments
WITH (
   ParentId='1206673375982078' --Id of Task , Project or ProjectBrief
 , SaveFolder='c:\temp' 
 , OverwriteFile=1
)

SQL Server

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

Download multiple attachments to local disk

<p>Downloads all attachments for a parent (task, project, or project brief) to a folder. Specify the parent ID and the folder path; saved file names include the attachment ID and original file name. You can choose whether to overwrite existing files. For tasks, this includes inline images in the description; for projects, files in the Key resources section; for project briefs, inline files in the brief.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM download_attachments
WITH (
   ParentId=''1206673375982078'' --Id of Task , Project or ProjectBrief
 , SaveFolder=''c:\temp'' 
 , OverwriteFile=1
)';

EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];