Getting Direct Link without creating Shared Link
Hi there! Is there a way through the API do get the direct link of a file (specifically image .png files) without creating a Shared Link? We're using the Python SDK if that matters. I tried the download_url but that isn't exactly a direct link. Our end goal is to use the URL in a tag.
-
Hello,
Thanks so much for using our Platform and Development Forum!
A few thoughts:
- You could use the file object. It's not listed with the other fields, but you can use the download_url field. An example of this would be GET https://api.box.com/2.0/files/5639341636?fields=download_url. This link will live for 15 minutes. You can also take a look here if you'd like to see an implemented version. I'm not sure this option will work for you if you need to use it long term though
- You could use the authenticated_download_url field
Best,
Kourtney
-
Thanks for the suggestions. We would need a permalink to it, so the first option would not work in our use case. I tried the authenticated_download_url but it does not load or when used in an img src tag.
This is the direct link we're looking for to use (it ends in the file extension .png), but it requires someone to go into the UI and make a shared link. We're trying to find a way to get the direct link without doing this step and through scripting/API since we have over 50000 png files. The direct links would then be fed into a reporting tool for display.
サインインしてコメントを残してください。
コメント
2件のコメント