create folder for special user using SDK
Hey there,
I'm trying to create a folders for a special user using java SDK api,
but i get there error :
com.box.sdk.BoxAPIResponseException: The API returned an error code
[403 | j83udhfv6ay420fn] access_denied_insufficient_permissions - Access denied -
insufficient permission
// create Box connection
BoxConnection boxConnection = new BoxConnection();
BoxDeveloperEditionAPIConnection api = boxConnection.getAppUserConnection(boxUserId);
// get box user
BoxUser boxUser = new BoxUser(api, boxUserId);
BoxFolder parentFolder = new BoxFolder(api, "0");
Thanks for help.
-
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(); -
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:
- 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.
- 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?
サインインしてコメントを残してください。
コメント
2件のコメント