Direct download link to a BOX file
Hi all,
we are developing a java tool that ingest files from box folder.
We know that the BOX API returns the BOX shared link, if present and if the folder owner has marked a file as shared.
If the shared link is missing (because the folder's owner has not generated it) how we can
build the complete HTTP link to the file?
Could you suggest us a rule to apply in order to (automatcally) build the complete HTTP link to a file in a BOX folder?
Thanks,
Antonio
-
Hello ,
to download files you have the REST API: https://docs.box.com/v2.0/reference#download-a-file
https://api.box.com/2.0/files/FILE_ID/content
That would be the proper way to do it. But, the appuser has to have access to the file. The shared link will not be always available and I would not use it as the way to retrieve documents.
I hope that helps.
Regards
-
Thanks,
we know that we can download a file via API.
We would like to know if there is a general rule/algorithm to apply in order to build the complete HTTP link to a file in a BOX folder, for visualizing the files in BOX UI or downloading or managing the files acccording to the user grants on such file.
Another question: if the file owner create a shared link to a files and an expiration date is not set, could you confirm us that the created shared link will not expire?
Thanks, Antonio
-
Hello Antonio,
I would say that there is no a general rule. At least I am not aware of any. I mean, when you execute the api.box.com/2.0/files/${"fileID"}/content method that returns a temporary URL like the following one:
dl.boxcloud.com/d/1/uydh28ktI4yTOgpeh7jf5gSVcx-(...) jtlyu9fOIeYVhGhf2nL460paarA../download
So.. to download a document the only URL to be built is the one with the API. What I do not get is what do you try to do 🙂 I mean, the URL to be built using the rest services is pretty easy and it is the pattern that you are searching for (for what I understood).
The only reason to use the "Shared links" approach I understand is because you are using an "open security shared link". I understand that the app you have opens those links that do not need authentication. Am I right? That way you can bypass the authentication step.
Sorry for not being able to help further on that.
Thank you.
Vicenç
-
Asif Kamboh has explained on his blog how to create a direct download link of box.com files with the help of pictures.
Please sign in to leave a comment.
Comments
6 comments