Using box CLI to access files / folders from an external collaborator.
An external collaborator has shared a folder with me, containing several files which I need to download to a linux server. I have view only access.
I use the box CLI, which is configured with an app that has server authentication with JWT and permission to "Perform actions as user". When I run:
box files:get <file-id> --as-user=<my-box-id>
I can see my own files just fine, and also download them with files:download.
However, when it comes to the files that was shared with me by the external collaborator, the box CLI doesn't work, and gives me the "Unexpected API Response [404 Not Found]" error.
I can download these shared files manually from my browser, but these are big files and it would be convenient if I could directly get them into my remote linux server.
The files and folder I want to download also have shared links with "Invited people only". I tried using the command below on the shared links:
box shared-links:get <shared-link-url> --as-user=<my-box-id>
But I keep getting the same [404 Not Found] error.
How do I use box CLI to download / get files and folders shared with me by external collaborators?
-
I have been struggling with this issue and finally figured out a solution - posting it here for any poor souls like me who finds the many threads like this one with no answers. The solution is to share the folder to your service account ID from the web page, just as if you were sharing to a new person by entering their email. You will find your service account ID under General Settings in the Box Developer Console. Once you've added the service account, the name of your app will show up as a user in the sharing panel. Make sure the access is set to Editor.
Please sign in to leave a comment.
Comments
1 comment