Skip to main content

I’m only getting the URL which is a direct download link and preview URL? how can I get the actual URL of the file? If its image file, I wanna get the URL with .jpg extension; not the preview or direct download ones

Hi


Not sure if this would work or if you already looked at it but creating a shared link can provide a static link that does contain the file extension as part of the link. This is still a download link though but not sure what else you would be looking for ?


https://developer.box.com/reference/put-files-id--add-shared-link/ - looks something like this


 "shared_link": {
"url": "https://app.box.com/s/kwio6b4ovt1264rnfbyqo1",
"download_url": "https://app.box.com/shared/static/kwio6b4ovt1264rnfbyqo1.pdf",


Best regards

Peter Christensen, Platform Solutions Engineer, Box


Thank you for the response.


In API documentation it says to use

url = client.file(file_id).get_shared_link(access='open', allow_download=True, allow_edit=True)


But the new version of SDK don’t have file attribute.

It says ‘BoxClient’ object has no attribute ‘file’


Hi

I think you need to use client.files if you are using the new autogen SDK



Rgds

Peter


Reply