Join BoxWorks 2024 to discover what's possible with content and AI!

Register now!

Download zip archive

get
https://dl.boxcloud.com/2.0
/zip_downloads/:zip_download_id/content

Returns the contents of a zip archive in binary format. This URL does not require any form of authentication and could be used in a user's browser to download the archive to a user's device.

By default, this URL is only valid for a few seconds from the creation of the request for this archive. Once a download has started it can not be stopped and resumed, instead a new request for a zip archive would need to be created.

The URL of this endpoint should not be considered as fixed. Instead, use the Create zip download API to request to create a zip archive, and then follow the download_url field in the response to this endpoint.

Request

application/json

Path Parameters

stringin pathrequired
Lu6fA9Ob-jyysp3AAvMF4AkLEwZwAYbL=tgj2zIC=eK9RvJnJbjJl9rNh2qBgHDpyOCAOhpM=vajg2mKq8Mdd

The unique identifier that represent this zip archive.

Response

application/octet-stream

Returns the content of the items requested for this download, formatted as a stream of files and folders in a zip archive.

application/jsonClient error

Returns an error if the ID of this download request is not valid. This error can also be returned if this URL has been called before. To re-download this archive, please create a new request for a zip download.

application/jsonClient error

Returns an error if the number of concurrent zip downloads has been reached for either the user or the enterprise.

  • user_too_many_concurrent_downloads - the maximum of 5 parallel downloads of zip archives per user has been met.
  • enterprise_too_many_concurrent_downloads - the maximum of 10 parallel downloads of zip archives per enterprise has been met.
application/jsonClient error

An unexpected client error.

get
Download zip archive
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -L GET "https://dl.boxcloud.com/2.0/zip_downloads/29l00nfxDyHOt7RphI9zT_w==nDnZEDjY2S8iEWWCHEEiptFxwoWojjlibZjJ6geuE5xnXENDTPxzgbks_yY=/content" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -o sample_curl.zip
TypeScript Gen
await client.zipDownloads.getZipDownloadContent(zipDownload.downloadUrl!);
Python Gen
client.zip_downloads.get_zip_download_content(zip_download.download_url)
.NET Gen
await client.ZipDownloads.GetZipDownloadContentAsync(downloadUrl: NullableUtils.Unwrap(zipDownload.DownloadUrl));
Java
ArrayList<BoxZipItem> items = new ArrayList<BoxZipItem>();
BoxZipItem file = new BoxZipItem("file", "12345");
BoxZipItem folder = new BoxZipItem("folder", "156472");
items.add(file);
items.add(folder);
BoxZip zip = new BoxZip(api);
FileOutputStream stream = new FileOutputStream();
BoxZipDownloadStatus zipDownloadStatus = zip.download("Another Awesome Zip File", items, stream);
stream.close();
if (zipDownloadStatus.getState() == BoxZipDownloadStatus.State.SUCCEEDED) {
    System.out.println("Zip downloaded successfully");
}
Python
name = 'test'
file = mock_client.file('466239504569')
folder = mock_client.folder('466239504580')
items = [file, folder]
output_file = open('test.zip', 'wb')
status = client.download_zip(name, items, output_file)
print(f'The status of the zip download is {status["state"]}')
.NET
BoxZipRequest request = new BoxZipRequest();
request.Name = "test";
request.Items = new List<BoxZipItemRequest>();

var file = new BoxZipRequestItem()
{
    Id = "466239504569",
    Type = BoxZipItemType.file
};
var folder = new BoxZipRequestItem()
{
    Id = "466239504580",
    Type = BoxZipItemType.folder
};
request.Items.Add(file);
request.Items.Add(folder);
Stream fs = new FileStream(@"c:\temp\MyTest.zip");

BoxZipDownloadStatus status = await _filesManager.DownloadZip(request, fs);
Node
var name = 'test',
items = [
	{
		type: 'file',
		id: '466239504569'
	},
	{
		type: 'folder',
		id: '466239504580'
	}
],
stream = new Readable();
client.files.downloadZip(name, items, stream)
	.then(status => {
		/* status -> {
				"total_file_count": 20,
				"downloaded_file_count": 10,
				"skipped_file_count": 10,
				"skipped_folder_count": 10,
				"state": "succeeded"
			}
		*/
	});