Box CLI and Bulk JSON format

SOLVED
Go to solution
Box Certified Professional

Box CLI and Bulk JSON format

I am trying to create a script which part of it is to create a predetermined folder in users root level.  I have been trying to use the --bulk-file-path= from the CLI v2 but keep getting an error of "Could not parse JSON input file..." for my json input.  The following format is what I am using.

 

{
     "entries": [
     {
          "parentid": "<parentfolderID>"
          "name": "NewFolder"
     }
     ]
}

 

I have also tried with just "id" in place of "parentid".  In general the Box CLI documentation is not very helpful with respect to the required format of these files.  When using the --help option it would be nice if the Arguments were actually the needed json elements to make it easier.

 

Any help is much appreciated.

 

thanks

Jeff

2 REPLIES 2
Highlighted
Box Employee

Re: Box CLI and Bulk JSON format

@hunnj The error you're seeing usually means that your JSON file is malformed (not that the key names are wrong).  You can use a JSON linter to make sure that your input JSON is valid before using it with the CLI.  The key names to use are the exact same as the flag and argument names you see when you run the command with --help, as long as you use those it should work for you.

Box Certified Professional

Re: Box CLI and Bulk JSON format

Looking at these scripts too long.  Was missing a pesky comma between items.

 

thanks again