How to get direct link of my file using SDK?

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


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 ? - looks something like this

 "shared_link": {
    "url": "",
    "download_url": "",

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’

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