Asana: Get attachments from an object
Asana attachments.getAttachmentsForObject: arguments, response, policy and SDK examples.
← Attachments operations · Get started
Operation asana.getattachmentsforobject
Provider route: GET /attachments. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/asana with npm, or alter-sdk-asana with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { AsanaIntegration } from "@alter-ai/asana";
async function execute(input: Parameters<AsanaIntegration["attachments"]["getAttachmentsForObject"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new AsanaIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.attachments.getAttachmentsForObject(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_asana import AsanaIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = AsanaIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.attachments.get_attachments_for_object(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Required within parent | Additional keys: not allowed |
query.opt_pretty | boolean | Optional | |
query.limit | integer | Optional | Minimum: 1 Maximum: 100 |
query.offset | string | Optional | |
query.parent | string | Required within parent | |
query.opt_fields | array | Optional | |
query.opt_fields[] | string | Each item | One of: connected_to_app, created_at, download_url, host, name, offset, parent, parent.created_by, parent.name, parent.resource_subtype, path, permanent_url, resource_subtype, size, uri, view_url |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | object | All variants apply | |
$ (allOf 1).data | array | Optional | |
$ (allOf 1).data[] | Model | Each item | Expand Get attachments from an object — response body — data, next page data item |
$ (allOf 1).next_page | Model | Optional | Expand Get goals — response body — data, next page next page |
$ (allOf 2) | Model | All variants apply | Expand Get attachments from an object — response body — data, next page |
Referenced models: Get attachments from an object — response body — data, next page data item, Get goals — response body — data, next page next page, Get attachments from an object — response body — data, next page
Schemas
Section titled “Schemas”Get attachments from an object — response body — data, next page data item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | 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. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
name | string | Optional | The name of the file. Read only: true |
resource_subtype | string | Optional | The service hosting the attachment. Valid values are `asana`, `dropbox`, `gdrive`, `onedrive`, `box`, `vimeo`, and `external`. |
Get goals — response body — data, next page next page
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | object | Alternative | *Conditional*. This property is only present when a limit query parameter is provided in the request. When making a paginated request, the API will return a number of results as specified by the limit parameter. If more results exist, then the response will contain a next_page attribute, which will include an offset, a relative path attribute, and a full uri attribute. If there are no more pages available, next_page will be null and no offset will be provided. Note that an offset token will expire after some time, as data may have changed. |
$ (anyOf 1).offset | string | Optional | Pagination offset for the request. Read only: true |
$ (anyOf 1).path | string | Optional | A relative path containing the query parameters to fetch for next_page Read only: true |
$ (anyOf 1).uri | string | Optional | A full uri containing the query parameters to fetch for next_page Format: uri Read only: true |
$ (anyOf 2) | null | Alternative |
Get attachments from an object — response body — data, next page
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | array | Required within parent | |
data[] | Model | Each item | Expand Get an attachment — response body — data data — sdk__Attachment Response |
next_page | Model | Optional | Expand Get goals — response body — data, next page next page |
Referenced models: Get goals — response body — data, next page next page, Get an attachment — response body — data data — sdk__Attachment Response
Get an attachment — response body — data data — sdk__Attachment Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A generic Asana Resource, containing a globally unique identifier.A generic Asana Resource, containing a globally unique identifier. 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. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
name | string | Optional | The name of the file. Read only: true |
resource_subtype | string | Optional | The service hosting the attachment. Valid values are `asana`, `dropbox`, `gdrive`, `onedrive`, `box`, `vimeo`, and `external`. |
created_at | string | Optional | The time at which this resource was created. Format: date-time Read only: true |
download_url | JSON | Optional | |
download_url (anyOf 1) | string | Alternative | 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. Format: uri Read only: true |
download_url (anyOf 2) | null | Alternative | |
permanent_url | JSON | Optional | |
permanent_url (anyOf 1) | string | Alternative | A stable URL for accessing the attachment through the Asana web application. This URL redirects to the file download location (e.g., an S3 link) if the user is authenticated and authorized to view the parent object (e.g., a task). Unauthorized users will receive a `403 Forbidden` response. This link is persistent and does not expire, but requires an active session to resolve. Format: uri Read only: true |
permanent_url (anyOf 2) | null | Alternative | |
host | string | Optional | The service hosting the attachment. Valid values are `asana`, `dropbox`, `gdrive`, `onedrive`, `box`, `vimeo`, and `external`. Read only: true |
parent | JSON | Optional | |
parent (anyOf 1) | Model | Alternative | Expand Get an attachment — response body — data data parent created by, gid, name, resource subtype, resource type |
parent (anyOf 2) | null | Alternative | |
size | JSON | Optional | |
size (anyOf 1) | integer | Alternative | The size of the attachment in bytes. Only present when the `resource_subtype` is `asana`. Read only: true |
size (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
view_url | JSON | Optional | |
view_url (anyOf 1) | string | Alternative | 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. Format: uri Read only: true |
view_url (anyOf 2) | null | Alternative | |
connected_to_app | boolean | Optional | 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`. Read only: true |
Referenced models: Get an attachment — response body — data data parent created by, gid, name, resource subtype, resource type
Get an attachment — response body — data data parent created by, gid, name, resource subtype, resource type
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A generic Asana Resource, containing a globally unique identifier.A generic Asana Resource, containing a globally unique identifier. The *task* is the basic object around which many operations in Asana are centered.A generic Asana Resource, containing a globally unique identifier.A generic Asana Resource, containing a globally unique identifier. The *task* is the basic object around which many operations in Asana are centered. The task this attachment is attached to. Read only: true |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
name | string | Optional | The name of the task. |
resource_subtype | JSON | Optional | |
resource_subtype (anyOf 1) | string | Alternative | The resource subtype of the parent resource that the filter applies to. |
resource_subtype (anyOf 2) | null | Alternative | |
created_by | object | Optional | [Opt In](/docs/inputoutput-options). A *user* object represents an account in Asana that can be given access to various workspaces, projects, and tasks. Read only: true |
created_by.gid | string | Optional | Globally unique identifier of the resource. |
created_by.resource_type | string | Optional | The type of resource. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: asana.getattachmentsforobject. Catalog operation: asana:getAttachmentsForObject. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["attachments:read"]