An attachment object represents any file attached to a task in Asana, whether it’s an uploaded file or one associated via a third-party service such as Dropbox or Google Drive.
AttachmentCompact
A Compact
object reflects the default fields returned after a successful API request. See input/output options to include more fields in the response.
Property | Type | Description |
---|---|---|
gid | string | Globally unique identifier of the resource, as a string. |
resource_type | string | The base type of this resource. |
name | string | The name of the file. |
resource_subtype | string | The service hosting the attachment. Valid values are asana , dropbox , gdrive , onedrive , box , vimeo , and external . |
{
"gid": "12345",
"resource_type": "attachment",
"name": "Screenshot.png",
"resource_subtype": "dropbox"
}
Attachment
Property | Type | Description |
---|---|---|
gid | string | Globally unique identifier of the resource, as a string. |
resource_type | string | The base type of this resource. |
name | string | The name of the file. |
resource_subtype | string | The service hosting the attachment. Valid values are asana , dropbox , gdrive , onedrive , box , vimeo , and external . |
connected_to_app | boolean | Whether the attachment is connected to the app making the request for the purposes of showing an app components widget. Only present when the resource_subtype is external or gdrive . |
created_at | string(date-time) | The time at which this resource was created. |
download_url | string(uri)¦null | The URL containing the content of the attachment. Note: May be null if the attachment is hosted by Box and will be null if the attachment is a Video Message hosted by Vimeo. If present, this URL may only be valid for two minutes from the time of retrieval. You should avoid persisting this URL somewhere and just refresh it on demand to ensure you do not keep stale URLs. |
host | string | The service hosting the attachment. Valid values are asana , dropbox , gdrive , box , and vimeo . |
parent | object¦null | The task this attachment is attached to. |
parent .gid | string | Globally unique identifier of the resource, as a string. |
parent .resource_type | string | The base type of this resource. |
parent .name | string | The name of the task. |
parent .resource_subtype | string¦null | The resource subtype of the parent resource that the filter applies to. |
permanent_url | string(uri)¦null | none |
size | integer | The size of the attachment in bytes. Only present when the resource_subtype is asana . |
view_url | string(uri)¦null | The URL where the attachment can be viewed, which may be friendlier to users in a browser than just directing them to a raw file. May be null if no view URL exists for the service. |
{
"gid": "12345",
"resource_type": "attachment",
"name": "Screenshot.png",
"resource_subtype": "dropbox",
"connected_to_app": true,
"created_at": "2012-02-22T02:06:58.147Z",
"download_url": "https://s3.amazonaws.com/assets/123/Screenshot.png",
"host": "dropbox",
"parent": {
"gid": "12345",
"resource_type": "task",
"name": "Bug Task",
"resource_subtype": "default_task"
},
"permanent_url": "https://s3.amazonaws.com/assets/123/Screenshot.png",
"size": 12345,
"view_url": "https://www.dropbox.com/s/123/Screenshot.png"
}