box / boxcli

A command line interface for interacting with the Box API.
https://developer.box.com
Apache License 2.0
222 stars 59 forks source link

How do you get the direct download link? #426

Closed Band-Aid closed 1 year ago

Band-Aid commented 1 year ago

Description of the Issue

I am trying to get the direct download URL using Box CLi This is possible using Box Rest API but I did not see any options with the CLI.

Steps to Reproduce

Rest API for shared links provides the download URL https://developer.box.com/reference/get-files-id--get-shared-link/

Expected Behavior

As a content manager I would like to be able to get direct download urls to embed them in my portal

Versions Used

Box CLI: @box/cli/3.5.0 darwin-x64 node-v14.19.3 Operating System: macos 13

arjankowski commented 1 year ago

Hi @Band-Aid ,

To get download url you just need to call:

$ box files:get ID

as shared-link is just a field of File

Hope this help, Artur

Band-Aid commented 1 year ago

Thanks! Though I am getting an error trying to create a shared link, I was trying to create link but I get the following error. Am I doing something wrong here?

% box files:shared-links:create 123456 --access:open
Unexpected argument: --access:open
arjankowski commented 1 year ago

Please try that way:

 box files:shared-links:create 123456 --access open

as param values we should pass after a space or a =sign

Band-Aid commented 1 year ago

Ah, thanks for pointing that out... I must be tired. Your docs clearly state to use =.

--access=access

Thanks again!