Welcome to the new Box Support website. Check out all the details here on what’s changed.

create folder for special user using SDK

New post

Comments

2 comments

  • oussama1

    here is my code updated : 

     

    BoxDeveloperEditionAPIConnection api = boxConnection.getAppUserConnection(boxUserId);

    // get box user
    BoxUser boxUser = new BoxUser(api, boxUserId);
    System.out.println(boxUser.getInfo());
    boxUser.getInfo();

    BoxFolder parentFolder = BoxFolder.getRootFolder(api);

    BoxFolder.Info childFolderInfo = parentFolder.createFolder(folderName);
    boxFolderResourceId = childFolderInfo.getID();
    0
    Comment actions Permalink
  • mwiller

     There are a couple reasons that I can think of off the top of my head why an application wouldn't be able to create a folder like this:

     

    1. Your enterprise might have disabled content creation at the root level, so no user can create folder underneath the root.  You might want to check if this is the case for your enterprise.
    2. Your application might not have configured the appropriate scopes to allow the app to create folders; make sure that in the Developer Console, your application has been given "Read and write all folders stored in Box" scope.  If it did not have that scope, you'll need to reauthorize the application in your enterprise (or have your admin do it) in order to update the scopes granted to the application.

    Could you check if either of these is the issue and let me know if that solves it for you?

    0
    Comment actions Permalink

Please sign in to leave a comment.