Skip to main content
Question

Zip download API behave incorrectly

  • May 23, 2025
  • 2 replies
  • 35 views

Forum|alt.badge.img

Hi guys,

I would like to know the case or cause of the following matters.

I implemented the shell using the Zip download API.
https://developer.box.com/reference/post-zip-downloads/
https://developer.box.com/reference/resources/zip-download/

When performing a ZIP download using the Create zip download API specified multiple file IDs,
the response was received with a status of 200, but the download file was not a ZIP file.

Case
- Three files of several MB are specified
- The downloaded file was 30 bytes
- The unzip command could not unzip the file
- JWT authenticated and running API in cURL on Linux Server

2 replies

Forum|alt.badge.img

Hi Tatsuya,

Please elaborate your question a bit more.

Are you sure the JWT service user has access to the files and can actually download them?

In the response you should get some status URL's, e.g.:

{
   "total_file_count":19,
   "downloaded_file_count":19,
   "skipped_file_count":0,
   "skipped_folder_count":0,
   "state":"succeeded",
 "download_url":"https://dl.boxcloud.com/2.0/zip_downloads/2N2...MrpbVL/content",
 "status_url":"https://api.box.com/2.0/zip_downloads/2N20...pbVL/status",
   "expires_at":"2023-02-03T15:21:35Z",
   "name_conflicts":[
      
   ]
}

What does your's say?

It would also help if you tell us a bit more about your "app running API in cURL on Linux server"

If I show you a python example, would that work for you?

Do you prefer a bash box CLI script?


Forum|alt.badge.img

Hi Rui,

Thanks for your reply.

After I run the Create zip download API, I run the "download_url" from the response.

Basically, the correct ZIP was downloaded, but there was a posting incident only once.

I do not use the CLI. I use cURL directly in bash.

for example:

curl -i -s -m 300 --tlsv1.2 -X POST "https://api.box.com/2.0/zip_downloads" -H "Authorization: Bearer ${bearer}"
DownloadapiUrl=`grep download_url ${ResponsefileName} | awk -F '["]' '{print $4}'`
curl -f -s -m 300 --tlsv1.2 -X GET "${DownloadapiUrl}" -o Download.zip

* This server does not install a "jq" command