I'm rather new at using either curl or the typeform API, so not just answers are appreciated but also any links or tutorials to help me on my way.
The problem I am facing is that when I try to get my uploaded image on typeform using either curl or wget, it does not save the image but rather the log in page from typeform
https://admin.typeform.com/login/
Recovering the download link itself using the API works fine. I used the command
curl --request GET --url https://api.typeform.com/forms/aLsAcC/responses --header 'Authorization: Bearer {MyId}'
This will return a JSON object with all responses. Inside this JSON file is the following block:
"field":{
"id":"SM3co23sAfCQ",
"type":"file_upload",
"ref":"2953330e-3c0b-4da3-bbb1-78a370152b10"
},
"type":"file_url",
"file_url":"https://admin.typeform.com/form/aLsAcC/field/SM3co23sAfCQ/results/1a4a6ab57b29-IMG_0354.JPG/download"
But then when I try to actually download the file it doesn't seem to work. It doesn't matter if I run:
curl -O https://admin.typeform.com/form/aLsAcC/field/SM3co23sAfCQ/results/1a4a6ab57b29-IMG_0354.JPG/download
curl --request GET --url https://admin.typeform.com/form/aLsAcC/field/SM3co23sAfCQ/results/1a4a6ab57b29-IMG_0354.JPG/download --header 'Authorization: Bearer {MyId}'
or
wget https://admin.typeform.com/form/aLsAcC/field/SM3co23sAfCQ/results/1a4a6ab57b29-IMG_0354.JPG/download
It always seems to give the same result.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url=https://admin.typeform.com/login/" />
<title>Redirecting to https://admin.typeform.com/login/</title>
</head>
<body>
Redirecting to <a href="https://admin.typeform.com/login/">https://admin.typeform.com/login/</a>.
</body>
</html>
Which is simply the login page from the site.
The weird thing is that when I use my browser itself it works just fine, so I suspect I am missing some form of authentication. It's probably a very simple problem, but Google didn't really help on that front.
So my question is, how do I download the response image. It doesn't matter if the final solution does not use curl, but a commandline tool or library is a must.
Thanks.