I'm trying to add an existing user (a user who registered a personal Box account with his email address) to a Box enterprise account using the Box Java SDK (https://github.com/box/box-java-sdk-v2) like so:
String email = "[email protected]";
String name = "John Doe";
BoxUserRequestObject boxUserRequestObject = BoxUserRequestObject.createEnterpriseUserRequestObject(email, name);
BoxUser createdUser = boxClient.getUsersManager().createEnterpriseUser(boxUserRequestObject);
However the SDK fails with an error saying:
com.box.boxjavalibv2.exceptions.BoxServerException: User with the specified login already exists
How do I programmatically invite that user to my enterprise account?