Issue with zip API endpoints
Hello. I am attempting to zip a Box folder and download that zip to a remote server using the zip API endpoints. When I use the "Create Zip Download" call, I successfully get a download_url. Unfortunately, when I try using the "Download zip archive" call, it runs as though something should happen, but I get nothing. When I use the "Get zip download status" call, it indicates that there are zero files/folders to download.
Any assistance would be greatly appreciated.
Jacob
-
Official comment
Hello,
Are you using one of our SDKs? If possible, it would help if I could see some of the code you are running.
Thanks,
Alex, Box Developer Advocate
Comment actions -
Hi Alex,
I'm not using an SDK - at this point I'm just running calls via curl, as described in the API docs.
Request access token:
curl -i -X POST "https://api.box.com/oauth2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=<client_id>" \
-d "client_secret=<client_secret>" \
-d "grant_type=client_credentials" \
-d "box_subject_type=enterprise" \
-d "box_subject_id=<box_subject_id>"Create zip download:
curl -i -X POST "https://api.box.com/2.0/zip_downloads" \
-H "Authorization: Bearer <access_token>" \
-d '{
"download_file_name": "<file_name>",
"items": [
{
"type": "folder",
"id": "<folder_id>"
}
]
}
'Download zip archive:
curl -i -X GET "https://dl.boxcloud.com/2.0/zip_downloads/<download_url>"
^This is the point where I'm running into the first issue. When I run this it gives me a 200 response but nothing seemingly downloads.
Then I look at the zip download status:
curl -i -X GET "https://api.box.com/2.0/zip_downloads/<download_url>" \
-H "Authorization: Bearer <access_token>"The response indicates zero total files/folders. I don't know how super useful this is with me scrubbing identifiers, but this is the workflow I used.
Thanks,
Jacob
Please sign in to leave a comment.
Comments
2 comments