Creating Box app user through java SDK
I am trying to create a java program that will create folders, files and search for certain files in Box Storage. For this i am trying to use the Box Java SDK and I created an application in Box (https://app.box.com/developers/services).
When I use the developer token i am able to traverse through my box parent/child folders. Since this token is valid for 60 mins I want to programmatically retrieve and set the token. I set up my application to use with JWS token signed with RSA key. My questions are
1) How to create box app user, is it always created through API or there is an option to create like managed user?
2) Based on my requirement above, do I need a service account or app user?
3)Is app user needs to created only once?
I tried below code but getting 404 error message.
BoxDeveloperEditionAPIConnection enterpriseApi = BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(ENTERPRISE_ID, CLIENT_ID, CLIENT_SECRET, encryptionPref, accessTokenCache);
BoxUser.Info user = BoxUser.createAppUser(enterpriseApi, APP_USER_NAME, params);
BoxDeveloperEditionAPIConnection api = BoxDeveloperEditionAPIConnection.getAppUserConnection(APP_USER_NAME, CLIENT_ID,
CLIENT_SECRET, encryptionPref, accessTokenCache);
Any help is appreciated.
-
Here's some examples:
https://github.com/kendomen/BoxJavaJWTExamples
I think you can just create an AppUser for your use-case. Unlike managed users, you won't be able to see its content on the BoxUI but you can see it through admin console -> content manager -> appUser
Please sign in to leave a comment.
Comments
1 comment