Back to AsanaGet An Attachment
Get the full record for a single attachment.
Input
type: object
properties:
parameters:
type: object
properties:
attachment_gid:
type: string
description: Globally unique identifier for the attachment.
opt_pretty:
type: boolean
description: >-
Provides “pretty” output.
Provides the response in a “pretty” format. In the case of JSON this
means doing proper line breaking and indentation to make it readable.
This will take extra time and increase the response size so it is
advisable only to use this during debugging.
opt_fields:
type: array
items:
type: string
description: >-
Defines fields to return.
Some requests return *compact* representations of objects in order to
conserve resources and complete the request more efficiently. Other
times requests return more information than you may need. This option
allows you to list the exact set of fields that the API should be sure
to return for the objects. The field names should be provided as
paths, described below.
The id of included objects will always be returned, regardless of the
field options.
required:
- attachment_gid
title: Parameters
Output
type: object
properties:
data:
type: object
properties:
gid:
description: Globally unique identifier of the resource, as a string.
type: string
readOnly: true
example: '12345'
x-insert-after: false
resource_type:
description: The base type of this resource.
type: string
readOnly: true
example: task
x-insert-after: gid
name:
description: The name of the file.
type: string
readOnly: true
example: Screenshot.png
resource_subtype:
description: >-
The service hosting the attachment. Valid values are `asana`,
`dropbox`, `gdrive`, `onedrive`, `box`, `vimeo`, and `external`.
type: string
example: dropbox
created_at:
description: The time at which this resource was created.
type: string
format: date-time
readOnly: true
example: '2012-02-22T02:06:58.147Z'
download_url:
description: >-
The URL containing the content of the attachment.
*Note:* May be null if the attachment is hosted by
[Box](https://www.box.com/) and will be null if the attachment is a
Video Message hosted by [Vimeo](https://vimeo.com/). 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.
type: string
format: uri
readOnly: true
nullable: true
example: https://s3.amazonaws.com/assets/123/Screenshot.png
permanent_url:
description: ''
type: string
format: uri
readOnly: true
nullable: true
example: https://s3.amazonaws.com/assets/123/Screenshot.png
host:
description: >-
The service hosting the attachment. Valid values are `asana`,
`dropbox`, `gdrive`, `box`, and `vimeo`.
type: string
readOnly: true
example: dropbox
parent:
type: object
properties:
gid:
description: Globally unique identifier of the resource, as a string.
type: string
readOnly: true
example: '12345'
x-insert-after: false
resource_type:
description: The base type of this resource.
type: string
readOnly: true
example: task
x-insert-after: gid
name:
description: The name of the task.
type: string
example: Bug Task
resource_subtype:
type: string
description: >-
The subtype of this resource. Different subtypes retain many of
the same fields and behavior, but may render differently in Asana
or represent resources with different semantic meaning.
The resource_subtype `milestone` represent a single moment in
time. This means tasks with this subtype cannot have a start_date.
enum:
- default_task
- milestone
- section
- approval
example: default_task
nullable: true
size:
description: >-
The size of the attachment in bytes. Only present when the
`resource_subtype` is `asana`.
type: integer
readOnly: true
example: 12345
view_url:
description: >-
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.
type: string
format: uri
readOnly: true
nullable: true
example: https://www.dropbox.com/s/123/Screenshot.png
connected_to_app:
description: >-
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`.
type: boolean
readOnly: true