Create a folder within a folder using c#




  • Bibek


    If you are using C#, you could use Box .NET SDK for that.

    In the SDK, you can perform every operations that you can find in Box API listing.

    For instance to create a new folder, use:

    CreateAsync(BoxFolderRequest folderRequest, IEnumerable<string> fields = null)

     where BoxFolderRequest is the Model where you pass the folder name and the parent folder ID

    e.g.  BoxFolderRequest fr = new BoxFolderRequest {

       "Name": "FolderA",

      "Parent": 1001


    where 1001 is the parent folder ID and pass the "fr" object to the CreateAsync folder. If you want to create FolderA inside FolderU then pass the ID of the FolderrU in Parent. 


    Even if you are not using SDK, calling the REST for creating a folder is pretty simple, you just need a ID of the parent folder. If your concern is to get the parent folder ID, then you need to either get that manually or by using the loop to get the folder information where you should be able to obtain the ID.  


    hope this helps.






    コメントアクション パーマリンク