HTTP Request activity - Get file from password-secured site

Hi,
When I try to open an image downloaded with this activity, the file seems to be broken or corrupted and it cannot be opened. My guess, and for what I have read in the forum, is that this is happening because the picture is not public (I tried with some random public urls and it works good). In other words, I think I need to somehow enter this site’s credentials in the activity, right?
Where should I enter this credentials? are these the same I use to login to the site?

I already tried filling the “Simple authentication” fields but still doesn’t work
image

Here´s the link to one of the pics, so you can see what the login interface is like:
link

Thanks!

That depends on how Authentication is handled. Simple Authentication essentially translates to Basic Authentication - if the server supports that, it would work. My best guess is that you do get a response - but not an image. Try opening the file you receive with a text editor - it’s likely HTML telling you you lack permission accessing that resource.

In addition, try storing the StatusCode in a variable - it should be 200 (in theory you could get a 200 result even when not authenticated, when the web server returns some alternative - such as an HTML - but that would’t be best practice).

Since your screenshot shows a custom login page, Basic Authentication won’t work (Basic Auth usually is done in a popup shown by the browser). You could ask them whether they offer OAuth1 or 2, or alternatively, use Web Automation to login and download the image.

The HTTP Request activity is meant to be used with web APIs. Do you have documentation from this website on the API?

What is the endpoint you’re using? If you type the endpoint into a web browser does it bring you to a a login page where you can type in your username and password? Although not best practice, I’ve found in the past that if the page sends you to a login page you can send the username and password in the headers of the request and it will work.

Okay, the downloaded “picture” contains the html code of the login page. It doesn’t seem to be any kind of response from the server.
Apparently basic auth doesnt not work either.
Knowing this, I might proceed to download the image by printing it to pdf, process I’ve been trying to avoid until now.
By the way, for future cases, what should be entered in the “ConsumerKey”, “ConsumerSecret”, token and tokensecret, when using OAuth1? Are the four fields required?
Thanks

Technically that is the server’s response - you are not authorized. However, I would recommend going for @Dave’s approach, unless Certronic offers a web API (which works well in conjunction with the HTTP request).

Documentation for all OAuth-related fields can be found here or here for 2.0.

1 Like

Sorry but I have no idea regarding this.

The endpoint I’m using is the link I left in the original post. When logged in, It opens a new tab with just the image I want. When logged off, It takes you to the login screen which I think is the case with the http request

Could you please detail this a little bit? thanks