I have a list of attachments' urls and would like to download it in one click. I have loaded the urls as an array in javascript. Then I use XMLHttpRequest to get the file content. However, it seems like the header or authentication is not correct when sending to Circuitsandbox (and later to Circuit for productive), I always get error 401 or 404 even though that url can be downloaded on browser.
So my question is what header/authentication should I use for my request?
This is my example:
var auth = user + ':' + password;
var hash = Base64.encode(auth);
...
xhr.setRequestHeader("Authorization", "Basic " + hash );
Should I use my user (email) and password for Circuitsandbox here?
Thanks you very much for any hint.