Hi All,
If anyone needs to create a download link for an existing file in Box you can do this by creating a "Share" using the Box API as per the guide here: https://developer.box.com/reference/put-files-id--add-shared-link/
If you include the option 'can_download' as 'true' a download_url is created, example body:
{"shared_link": {"access":"open","password":"P@ssW0rd!","unshared_at":"2021-12-31T10:53:43-08:00","permissions":{"can_download": true}}}
Example response:
{"type":"file","id":"818460444201","etag":"5","shared_link":{"url":"https:\/\/XXXXX.box.com\/s\/muitvhgewlm60e5xrtasybrepitarht6","download_url":"https:\/\/XXXXX.box.com\/shared\/static\/muitvhgewlm60e5xrtasybrepitarht6.pdf","vanity_url":null,"vanity_name":null,"effective_access":"open","effective_permission":"can_download","is_password_enabled":true,"unshared_at":"2021-12-31T10:53:43-08:00","download_count":0,"preview_count":0,"access":"open","permissions":{"can_preview":true,"can_download":true}}}
Hope this helps.
Any problems let me know and I'll try to help,
Nick
Question
Tip: create a download link for a file
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
