I need help converting a curl request into the HTTP request action

Hello!

I’m pretty new to n8n and programming. I’m currently following this article to get a download link for my Trello attachment.

But I’m struggling to make a request like this with the HTTP Request action:

curl -H "Authorization: OAuth oauth_consumer_key=\"{{key}}\", oauth_token=\"{{token}}\"" https://api.trello.com/1/cards/5e839f3696a55979a932b3ad/attachments/5edfd184387b678655b58348/download/my_image.png

I put the image URL into the URL field, but I have no clue where to put the Authorization stuff.

Can anyone help? Thanks in Advance!

Hi @tomato_planet Welcome to the community! :tada: … have you tried the Trello node? https://n8n.io/integrations/n8n-nodes-base.trello

Yeah, I’ve used that already to get the attachment link. However I want to give that link to the Facebook Graph API to post the picture, and therefore need to execute that HTTP request, as the “normal” attachment links are only accessible when logged in. That curl request is supposed to generate a download link that’s valid for one hour (without any login needed), which would be the correct thing to use in my case.
But I’m having problems to “convert” that curl function to a normal HTTP Request…

Hi @tomato_planet this goes over my head right now, and I hope that somebody else can help you with this.

The -H is a header so you would need to put that in the header options. As it is oauth though you could configure the oauth credential type and see if that works for you.

Hi again, thanks @dickhoning and @Jon for the help.

I was now able to create the link with the authorization in the header and get the picture as a file.
However, I need to upload it to Google Drive to get a link to the image which I can give to the Graph API.
When trying to do so, I always get a 403 Error. I used the OAuth method and entered everything correctly. It showed me a green box with “Connected successfully”. Any idea on what I did wrong?
image

You’re fetching a binary file, but your HTTP request is set to fetch a string or something similar
Make sure you set the option to fetch binary data

I already set the option to fetch a binary file.
After some more digging through the forum, I was able to find the issue:
I didn’t have the Google Drive API enabled for my project. :frowning_with_open_mouth:
Got everything working now!

1 Like