Get Download URL

Get Download URL

The official Box SDKs return the binary data when downloading a file. To get the download URL for the data instead, use the following SDK methods.

curl -i -X GET "" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Uri downloadUri = await client.FilesManager.GetDownloadUriAsync(id: "11111");
file_id = '11111'
download_url = client.file(file_id).get_download_url()
print(f'The file\'s download URL is: {download_url}')
	.then(downloadURL => {
		// downloadURL -> ''


If you are not using one of our SDKs its important to make sure your HTTP client does not automatically follow HTTP redirects. When redirects are automatically followed, your code will detect the location header returned by the API and follow it to get the binary data.

Download URL expiry

Although this download URL can be passed to a user's browser to allow them to download the file, the URL does expire and should be requested again for any further downloads. In most cases the download URL is valid for 15 minutes, after which a new URL needs to be requested. This expiration time may be subject to change without any prior notification.