0
votes

I building a java desktop app, It can download and upload files with box.com I've added a few libraries in https://github.com/box/box-java-sdk-v2/tree/master/BoxJavaLibraryV2/libs

It worked, but I need i get user's email to manage account. I can't find example in

github.com/box/box-java-sdk-v2

To get it.

Thank for your reading, i'm so sorry for my bad english.

1
This is my new code, I hope you can save time with it: boxclient = new BoxClient(BOX_CLIENT_ID, BOX_CLIENT_SECRET, hub, parser, boxconfig); BoxOAuthToken token; try { token = boxclient.getOAuthManager().refreshOAuth(box_com_token, BOX_CLIENT_ID, BOX_CLIENT_SECRET); box_com_token = token.getRefreshToken(); boxclient.authenticate(token); BoxUser user = boxclient.getUsersManager().getUser("me", null); }catch (BoxRestException | BoxServerException | AuthFatalFailureException e) { // TODO Auto-generated catch block e.printStackTrace(); } - Ninh

1 Answers

0
votes

You can query a user's email using the Get's User Info API. The user's email will be returned in the JSON response as the value for the key "login".