BoxFolder API createFolder
Hi All,
I've box account with my email address (I assume it is called box user), also I created on app box_e_api with Application Access : Enterprise.
Using BoxFolder java api, created a folder, it seems to created under box_e_api as owner. I saw this when downloaded the folder_tree_report from Box.
How do I access folders and files created via box.com on my login, using box_e_api user and vice versa ? I am missing some sharing privileges somewhere. Any help is appreciated.
thank you,
Srinivas
-
Hi
Thanks for coming to the Box Community Developer forums! It sounds like you're well on your way to making calls with your newly created app.
In order to access files and folders between your App User and your Managed User, your App User will either need to be collaborated on the folders you would like the App User to access, or you will need to enable the "Perform Actions as Users" feature in your Configuration page for your app. Once the As-User header is enabled, you'll be able to generate tokens for the user you want to perform the action, or you'll be able to pass the user's User ID in the header of the call to perform an upload as if you were the user themselves.
Let me know if you have any further questions about these concepts, and thanks for reaching out to the Box Community!
-
Great, Thanks for the reply.
Just before seeing your reply, I did follow the same method as you suggested.
Iterator users = (Iterator) BoxUser.getAllEnterpriseUsers(client).iterator();
while (users.hasNext())
{
BoxUser.Info u = users.next();
System.out.println(u.getID() + " " + u.getName() +" "+u.getLogin());
}System.out.println("*************");
BoxUser.Info currentUserInfo = BoxUser.getCurrentUser(client).getInfo();
System.out.println("Current User "+ currentUserInfo.getID() + " " + currentUserInfo.getName());
client.asUser(***phone number removed for privacy***");
currentUserInfo = BoxUser.getCurrentUser(client).getInfo();The information you provided really helpful, I will revise my code accordingly.
Thank you,
Srinivas.
Please sign in to leave a comment.
Comments
2 comments