Need help downloading attachments via REST API

Hello, I’m attempting to download attachments from the REST API; however, download_url in the REST response for the asset is not an API location.

Rather than being something like:

https://app.asana.com/api/1.0/asset/asset_id, it’s
https://app.asana.com/app/asana/-/get_asset?asset_id=#############

So, it doesn’t use the API KEY for authentication, and thus I can’t download it from within my API client. Is there any way to get an API KEY authenticated download URL or the direct URL to AWS (or to wherever the actual file resides)?

Thanks,

Jim

Hey, check permanent_url.

More info: asana - Permanent view_url to uploaded attachments - Stack Overflow

Nice, thanks! I’ll check it out. What threw me for a loop was that permanent_url is not document, and more importantly, not included in the organizational exports (see example below).

{“__object_id”:#############,“__type”:“Asset”,“__creation_time”:“2018-07-10 20:52:47”,“name”:“a.gif”,“download_url”:“https://app.asana.com/app/asana/-/get_asset?asset_id=#########”}

I can receive the “download_url” from the api for a file stored by Asana (in S3) - but when I try to GET the url using curl or a programming language I get the following error (in XML):

<?xml version="1.0" encoding="UTF-8"?>

<Error><Code>InvalidArgument</Code><Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message><ArgumentName>Authorization</ArgumentName><ArgumentValue>Bearer 0/15c77ee426100fe162fa32dedff9f199</ArgumentValue><RequestId>A68EE7DBE1F1E5D2</RequestId><HostId>nGILEseHyBUeHlCJKuTUOf3jzOoMQE18GCqJ81WmFV3Ock+0X5j+RrAIftItIL7AR58bqLELwZ0=</HostId></Error>

@anon19641203 - did you ever figure this out? I am trying to use the “download_url” to archive attachments and haven’t been able to find any way of grabbing this file.

Thanks!