I am attempting to use curl
(or any other viable alternative) to download a zip report from SalesForce, but I seem to be unable to do so. I am using syntax:
curl -o my_file.zip 'https://login.salesforce.com/?un=username&pw=password&ec=123&startURL=%2Fservlet%2Fservlet.OrgExport%3Fid%3Dfile_id%26fileName%3Dfile_name.ZIP'
If I navigate my browser in incognito to the url, I don't need to do anything further and the file begins to download. The curl
command seems to do nothing, however.
I have also tried to store my cookies in a text file:
curl -c cookies.txt 'https://login.salesforce.com/?un=username&pw=password
and then passing in the cookies to my download url:
curl -b cookies.txt 'https://login.salesforce.com/?ec=123&startURL=%2Fservlet%2Fservlet.OrgExport%3Fid%3Dsample_id%26fileName%3Dsample_filename.ZIP'
Contents of cookies.txt
:
.salesforce.com TRUE / FALSE 1234567890 BrowserId sample_browser_id
.salesforce.com TRUE / FALSE 0 inst APPj
.salesforce.com TRUE / TRUE 1234567890 login username@email.com
.salesforce.com TRUE / FALSE 1234567890 com.salesforce.LocaleInfo us
.salesforce.com TRUE / FALSE 1234567890 oinfo sample_oinfo