expiring embed link - I just want a direct link to the image source
AnsweredI'm building a service that uses Box as a backend store, and provides access to that content to other internal apps.
The files uploaded to Box are viewed within our applications, rather than on the Box site.
This all works great for non-sensitive files, since we can generate download and preview links for those documents, and direct our applications to those source URLs as appropriate.
However, some documents are sensitive in nature, so I'd like to generate a link for my client apps that they can use for a short term, after which the source will no longer be available.
The existing "expiring embed link" facility does almost what I need. I am able to generate one of these links, and return it to my clients, but they actually just want to be able to get the image content, not an html widget.
Is there a way for me to return just the image source? (I can manually follow the link, inspect the Box UI page and extract the image source url).
Is there a supported programmatic way for me to return the expiring image source url to my clients?
Thanks for any help.
-
2 ways:
You can get the converted representation of the image (what our preview widget uses underneath).
For this refer to https://developer.box.com/v2.0/reference#representations
OR
You can get the link to the originally uploaded image by getting the download_url instead of the expiring_embed_url.
In that case you are sending the actual original image, and not our preview widget and not our converted representation of it that the preview widget uses.
Do note that, in doing so, access stats for the file will be different. You will see image downloads instead of previews.
Please sign in to leave a comment.
Comments
2 comments