Sign up ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I am doing integration salesforce with so after uploading file i want the download that file.Like in google drive we set approval_prompt=force and response body contain webContentLink for to download that file.How i can get downloadable link ?

share|improve this question

2 Answers 2

up vote 1 down vote accepted
 public static String downloadBoxFile(String fileId){
    BoxAuthParser bparser;
    Http h = new Http();
    HttpRequest req = new HttpRequest();
    string endPointValue = '';
    req.setHeader('Authorization', 'Bearer '+bparser.access_token);
    HttpResponse res = h.send(req);
    return res.getHeader('Location');

The above method should help you.The GET request header has a location and that returns the URL for download of the file .

share|improve this answer
Above code working fine and finaly my this problem solve. – sandeep Aug 2 '14 at 13:02
Sir i have one more issue that how i can get download link in dropbox for uploaded file . – sandeep Aug 2 '14 at 13:14
When you preview at top you have down arrow for you to download file from drop box.Hope that helps – Mohith Shrivastava Aug 2 '14 at 14:07
I want the link of file in response body so using this link i can download uploaded file on I want link of uploaded file in dropbox using rest api. – sandeep Aug 4 '14 at 5:39

This is the endpoint to get all files from

With file Id you can get file download information in json format.

share|improve this answer
sir i want the link of single file among more files. – sandeep Aug 2 '14 at 8:39
In JSON you will get download link of each file associated with its other information by which you can download them. @sandeep – Ashwani Aug 2 '14 at 8:46
I am not getting link of file but i am getting id and name of uploaded file so now i can get url of uploaded file using id or name of file. – sandeep Aug 2 '14 at 9:21
Have answered the same .Pls take a look.Thanks – Mohith Shrivastava Aug 2 '14 at 9:46
@regal The body will be empty .A location variable in header is needed for download. – Mohith Shrivastava Aug 2 '14 at 9:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.