OAuth Using BoxCLI Basics
AnsweredI'm using Box CLI to run a command batch. It will run and pass authentication when the batch file (.bat) runs under the personal ID I did the OAuth setup with. However it won't pass authentication when it's running under an admin ID set up to run batch jobs in our environment. I get the errors below. I can't quite figure out what needs to be done. It appears I need an environment file or some way to get tokens (I haven't found the refresh token). I assume this is all pretty basic but I haven't found the magic link which explains it all yet especially when using the Box CLI. Any references or solutions are appreciated.
The batch command looks like this:
"C:\Program Files\@boxcli\bin\box" files:upload --bulk-file-path=E:/Scripts/BoxUploadFiles.csv
No default environment found.
It looks like you haven't configured the Box CLI yet.
See this command for help adding an environment: box configure:environments:add --help
Or, supply a token with your command with --token.
-
If I understand it right, what you are trying to do is to run Box CLI commands in non-interactive way, so there is a background process with runs cli commands.
Based on error, it looks like you don't have configured CLI yet. Can you try login to Box using OAuth CLI guide and then perform the batch command from your laptop.
Alternatively you can try look into JWT authentication - https://developer.box.com/guides/cli/cli-docs/jwt-cli/
Post is closed for comments.
Comments
1 comment