question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Download shared folder

See original GitHub issue
  • I have checked that the [SDK documentation][sdk-docs] doesn’t solve my issue.
  • I have checked that the [API documentation][api-docs] doesn’t solve my issue.
  • I have searched the [Box Developer Forums][dev-forums] and my issue isn’t already reported (or if it has been reported, I have attached a link to it, for reference).
  • I have searched [Issues in this repo][github-repo] and my issue isn’t already reported.

Description of the Issue

I got errr for the command below

box folders:download 144 # ID of a folder that is shared to me.
Unexpected API Response [404 Not Found | asdasdhasdahdasdfasdhahdasd] not_found - Not Found

Expected Behavior

Be able to download the folder to my local machine. Alternatively, I should be able to use curl or wget to download the folder with the shared link.

Versions Used

Box CLI: @box/cli/2.9.0 linux-x64 node-v16.6.1 Operating System: Ubuntu 18.04

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mwwodacommented, Nov 24, 2021

If you want to download the contents of a folder using a shared link, you must enumerate the files one-by-one and download them separately. It’s not possible to download the entire folder this way.

You can get the content of this folder by calling the /folders/{folderId}/items endpoint like this

curl -i -X GET "https://api.box.com/2.0/folders/150744142852/items" \
    -H "Authorization: Bearer <Token>" \
    -H "BoxApi: shared_link=https://app.box.com/s/9alg80kaqluqvvrjdgxwkvq9v4oxzyw1"

This will return ids of the files inside this folder. You can then call download on each of them. So the example curl for a single file would look like this

curl -i -X GET "https://app.box.com/files/888201304524/content " \
     -H "Authorization: Bearer <TOKEN>" \
     -H "BoxApi: shared_link=https://app.box.com/s/9alg80kaqluqvvrjdgxwkvq9v4oxzyw1" \
     -L -o downloadedFile

I don’t think that downloading zip with a share link is possible at the moment. 401 error you posted indicates problem with your token.

0reactions
stale[bot]commented, Aug 9, 2022

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box CLI and feel free to open another PR/issue at any time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage download settings for shared mail folders in Cached ...
Manage download settings for shared mail folders in Cached Exchange mode in Outlook · Registry values, Group Policy, and Office Customization ...
Read more >
Download Files and Shared Folders - Newforma Help
To download files from a shared folder. 1. Right click on the file and select Download from the popup menu. Double-clicking on a...
Read more >
Q: How do I turn off Download Shared Folders (caching) for ...
Click on your account, then on Change More Settings then select the Advanced tab. Clear the "Download shared folders (excludes mail folders)" ...
Read more >
How to Download from Google Drive Shared With Me?
Step 2. Click "Share with me" in the main menu on the left. You should see a list of all the files and...
Read more >
[SOLVED] "Download Shared Folders" in Outlook - any issues ...
"Download Shared Folders" in Outlook - any issues with turning off? ... Hi all,. We currently have a Shared Mailbox in Exchange that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found