trello REST API: getting 401 (unauthorized) when downloading attachment

SergeyStoyan August 11, 2021

Hi,

My app had worked well though the trello API until yesterday. The same client could read cards and download attachments. Now it only can read cards but when trying to download attachments, it gets 401 response. The app uses the user token for authentication. When downloading, it uses the same cookie scope obtained from the previous API REST requests and it had worked before yesterday. Nothing was changed in the app! I've updated the user token - to no success. 

Can anybody suggest what happens there? How attachments can be downloaded though the API?

Thank you!

 

 

2 answers

1 accepted

0 votes
Answer accepted
SergeyStoyan August 11, 2021

Thank you for the right direction!

That page is actually obsolete and forwards to an update: Update: Authenticated Access to S3 - Trello / Trello Announcements - The Atlassian Developer Community

 

They still advise there that does not work anymore:

If you are using the files directly in your application as a single user, you can add in an API key and token to the request to the /download/ URL.

 

And what works for me right now:

Making a GET request with the key and token in the Authorization header will return the hosted file.

For instance, here is how you’d make the request with curl for an attachment with the ID 5edfd184387b678655b58348 and the attachment file named my_image.png:

curl -H "Authorization: OAuth oauth_consumer_key=\"{{key}}\", oauth_token=\"{{token}}\"" https://api.trello.
1 vote
Michael Pryor
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 11, 2021

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events