Unable to Create New Users via API


#1
Hello,

We have a Salesforce integration with GroupDocs which allows our users to annotate documents created within our system and uploaded to GroupDocs. We have 9000+ users and new users coming on board every day. It seems sometime in the past month we've been received quite a few requests that our users are unable to access/annotate documents because they aren't able to access the document.

What we’ve found is, their user accounts are not being created via the API call. We currently have no limit as to the amount of users we’re allowed to create.

The code we’ve written to create their account is as follows:

GD_GroupDocsSecurityHandler securityHandler = new GD_GroupDocsSecurityHandler(GD_Utils.privateKey);
GD_ApiClient api = new GD_ApiClient(securityHandler);
GD_MgmtApi mgmtApi = new GD_MgmtApi(api);
//Check if user exists:
String userEmail = UserInfo.getUserEmail();
String firstname = UserInfo.getFirstName();
String lastname = UserInfo.getLastName();
GD_UserInfo userObj = new GD_UserInfo();
GD_RoleInfo role = new GD_RoleInfo();
List<GD_RoleInfo> rolesList = new List<GD_RoleInfo>();
//Set user role Id. Can be: 1 - SysAdmin, 2 - Admin, 3 - User, 4 - Guest
role.name = ‘User’;
role.id = 3;
//Set user role name. Can be: SysAdmin, Admin, User, Guest
userObj.nickname = userEmail;
userObj.firstname = firstname;
userObj.lastname = lastname;
userObj.primary_email = userEmail;
userObj.id = 0;
userObj.apps = ‘127’;
userObj.alerts_eanbled = false;
rolesList.add(role);
userObj.roles = rolesList;
GD_UpdateAccountUserResponse createAccountUserResponse = mgmtApi.UpdateAccountUser(GD_Utils.clientId, userObj.primary_email, userObj);
string status = createAccountUserResponse.status;
if (status.containsIgnoreCase(‘ok’)) {
GD_UpdateAccountUserResult result = createAccountUserResponse.result;
String newUserGuid = result.guid;
status += 'newUserGuid: ’ + newUserGuid;
StUtils.StDebug('New User guid: ’ + newUserGuid);
userObj.guid = newUserGuid;
} else {
StUtils.StDebug('Create user error: ’ + createAccountUserResponse.error_message);

    }
    return userObj;

Can you provide some assistance? Our admin email for GroupDocs is admin@mavengrp.com

<span style=“color: rgb(255, 255, 255); font-family: “San Francisco”, -apple-system, system-ui, “.SFNSText-Regular”, sans-serif; font-size: 16px; letter-spacing: -0.24px; white-space: pre-wrap; background-color: rgb(0, 132, 255);”>

#2

Hi,


We are sorry to hear that you have such issue. We will check it and return to you with the results.

Sorry for the inconvenience.

#3

Hi again,


We fixed the issue. Please try again and notify us with the results.

Best regards.