0
votes

I am using BOX JAVA SDK to access the box functionalities.

I've got enterpriseId and also userId to login into Box as an enterprise user.

I am able to login using enterpriseId but not with userId.

BoxDeveloperEditionAPIConnection boxjwtconnection=new BoxDeveloperEditionAPIConnection(userId,devedienttype.USER,clientId,clientSecret,jwtenrypref,null);

This is the exception I am getting when I am trying to login using userId.

Exception in thread "main" com.box.sdk.BoxAPIException: The API returned an error code: 401
at com.box.sdk.BoxAPIResponse.<init>(BoxAPIResponse.java:69)
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:421)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:209)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:184)
at com.box.sdk.BoxUser.getCurrentUser(BoxUser.java:139)

Where I am doing mistakes? Any solutions? Thanks in advance

2

2 Answers

0
votes

I believe you have to have your client_id user-enabled. You can open ticket with Box or you can do it yourself through the new developer console.