Download trello attachment

When I try to download a PDF from Trello using an HTTP request it only returns a Trello error page, could anyone help me?

In the html file that returned there is this message, the credentials are correct I still don’t know what it could be

Your browser was unable to load all of Trello’s resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again and if that doesn’t work, check out our troubleshooting guide .

Hi @LorenzoSbeghen, looks like Trello has changed how attachments can be retrieved programmatically:

So you could not use an URL like$cardId/attachments/$attachmentId/download/$filename to fetch your attachment programmatically, instead you’d need to call{idCard}/attachments/{idAttachment}/download/{attachmentFileName}.

Also, this endpoint doesn’t accept Trello credentials via query parameters (which is how the other endpoints used to work and also how n8n the Trello credentials in n8n work), but instead requires credentials in the header. Until n8n implements this, you can’t easily re-use your existing credentials for this unfortunately. It would be much easier to use an external storage for your binary data and this is what I’d recommend here.

In case this isn’t an option you could for development purposes use a simple echo service (like this one) to extract your Trello key and then re-use this key. This does however mean your credentials are shared with a 3rd party unless you run a suitable echo service yourself. A more secure option would be to host this service yourself, for example by routing this through a separate webhook-powered workflow responding with the values of each query parameter, but for simplicity I have not included this in my example.

Here’s the basic idea:

This approach will leave you with the actual attachment file in the final step:

Hope this helps!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.