/** * Create Employee { "Email":"*****@*****.**", "FirstName":"Name", "LastName":"Last Name", * "Company":"Company", "Password":"******", "StorageQuotaLimitGB":50, "Preferences": { * "CanResetPassword":true, "CanViewMySettings":true }, "DefaultZone": { "Id":"zoneid" }, * "IsAdministrator": false, "CanCreateFolders": false, "CanUseFileBox": true, "CanManageUsers": * false, "Roles": [ "CanChangePassword", "CanManageMySettings", "CanUseFileBox, "CanManageUsers, * "CanCreateFolders, "CanUseDropBox, "CanSelectFolderZone, "AdminAccountPolicies", * "AdminBilling", "AdminBranding", "AdminChangePlan", "AdminFileBoxAccess", * "AdminManageEmployees", "AdminRemoteUploadForms", "AdminReporting", "AdminSharedDistGroups", * "AdminSharedAddressBook", "AdminViewReceipts", "AdminDelegate", "AdminManageFolderTemplates", * "AdminEmailMessages", "AdminSSO", "AdminSuperGroup", "AdminZones", "AdminCreateSharedGroups", * "AdminConnectors" ] } Creates a new Employee User (AccountUser) and associates it to an Account * The following parameters from the input object are used: Email, FirstName, LastName, Company, * DefaultZone, Password, IsEmployee, IsAdministrator, CanCreateFolders, CanUseFileBox, * CanManageUsers, Preferences.CanResetPassword and Preferences.CanViewMySettings. Other * parameters are ignoredStorageQuotaLimitGB parameter is optional. If not specified or equal to * -1 the account default storage quota value will be set for the User. * * @param user * @param pushCreatorDefaultSettings (default: false) * @param addshared (default: false) * @param notify (default: false) * @return The new employee user */ public ISFQuery<SFUser> createAccountUser( SFAccountUser user, Boolean pushCreatorDefaultSettings, Boolean addshared, Boolean notify) throws InvalidOrMissingParameterException { if (user == null) { throw new InvalidOrMissingParameterException("user"); } if (pushCreatorDefaultSettings == null) { throw new InvalidOrMissingParameterException("pushCreatorDefaultSettings"); } if (addshared == null) { throw new InvalidOrMissingParameterException("addshared"); } if (notify == null) { throw new InvalidOrMissingParameterException("notify"); } SFApiQuery<SFUser> sfApiQuery = new SFApiQuery<SFUser>(this.client); sfApiQuery.setFrom("Users"); sfApiQuery.setAction("AccountUser"); sfApiQuery.addQueryString("pushCreatorDefaultSettings", pushCreatorDefaultSettings); sfApiQuery.addQueryString("addshared", addshared); sfApiQuery.addQueryString("notify", notify); sfApiQuery.setBody(user); sfApiQuery.setHttpMethod("POST"); return sfApiQuery; }
/** * Get User Retrieve a single user, by ID or email, or the currently authenticated user. * * @param id (default: null) * @param emailAddress (default: null) * @return the requested User object */ public ISFQuery<SFUser> get(String id, String emailAddress) throws InvalidOrMissingParameterException { if (id == null) { throw new InvalidOrMissingParameterException("id"); } if (emailAddress == null) { throw new InvalidOrMissingParameterException("emailAddress"); } SFApiQuery<SFUser> sfApiQuery = new SFApiQuery<SFUser>(this.client); sfApiQuery.setFrom("Users"); sfApiQuery.addQueryString("id", id); sfApiQuery.addQueryString("emailAddress", emailAddress); sfApiQuery.setHttpMethod("GET"); return sfApiQuery; }
/** * Forgot Password Triggers a reset password email * * @param email * @param resetOnMobile (default: false) */ public ISFQuery forgotPassword(String email, Boolean resetOnMobile) throws InvalidOrMissingParameterException { if (email == null) { throw new InvalidOrMissingParameterException("email"); } if (resetOnMobile == null) { throw new InvalidOrMissingParameterException("resetOnMobile"); } SFApiQuery sfApiQuery = new SFApiQuery(this.client); sfApiQuery.setFrom("Users"); sfApiQuery.setAction("ForgotPassword"); sfApiQuery.addQueryString("email", email); sfApiQuery.addQueryString("resetOnMobile", resetOnMobile); sfApiQuery.setHttpMethod("POST"); return sfApiQuery; }
/** * Send notification email address to this email address for verification * * @param email * @return User */ public ISFQuery sendConfirmationEmail(String email) throws InvalidOrMissingParameterException { if (email == null) { throw new InvalidOrMissingParameterException("email"); } SFApiQuery sfApiQuery = new SFApiQuery(this.client); sfApiQuery.setFrom("Users"); sfApiQuery.setAction("SendConfirmationEmail"); sfApiQuery.addQueryString("email", email); sfApiQuery.setHttpMethod("POST"); return sfApiQuery; }
/** * Set email address as the primary email address for CURRENT user * * @param email * @return User */ public ISFQuery<SFUser> makePrimary(String email) throws InvalidOrMissingParameterException { if (email == null) { throw new InvalidOrMissingParameterException("email"); } SFApiQuery<SFUser> sfApiQuery = new SFApiQuery<SFUser>(this.client); sfApiQuery.setFrom("Users"); sfApiQuery.setAction("MakePrimary"); sfApiQuery.addQueryString("email", email); sfApiQuery.setHttpMethod("POST"); return sfApiQuery; }
/** * Delete User Removes an user * * @param url * @param completely (default: false) */ public ISFQuery delete(URI url, Boolean completely) throws InvalidOrMissingParameterException { if (url == null) { throw new InvalidOrMissingParameterException("url"); } if (completely == null) { throw new InvalidOrMissingParameterException("completely"); } SFApiQuery sfApiQuery = new SFApiQuery(this.client); sfApiQuery.setFrom("Users"); sfApiQuery.addIds(url); sfApiQuery.addQueryString("completely", completely); sfApiQuery.setHttpMethod("DELETE"); return sfApiQuery; }
/** * Create Client User { "Email":"*****@*****.**", "FirstName":"Name", "LastName":"Last Name", * "Company":"Company", "Password":"******", "Preferences": { "CanResetPassword":true, * "CanViewMySettings":true }, "DefaultZone": { "Id":"zoneid" } } Creates a new Client User and * associates it to an Account The following parameters from the input object are used: Email, * FirstName, LastName, Company, DefaultZone, Password, Preferences.CanResetPassword and * Preferences.CanViewMySettingsOther parameters are ignored * * @param user * @param pushCreatorDefaultSettings (default: false) * @return The new user */ public ISFQuery<SFUser> create(SFUser user, Boolean pushCreatorDefaultSettings) throws InvalidOrMissingParameterException { if (user == null) { throw new InvalidOrMissingParameterException("user"); } if (pushCreatorDefaultSettings == null) { throw new InvalidOrMissingParameterException("pushCreatorDefaultSettings"); } SFApiQuery<SFUser> sfApiQuery = new SFApiQuery<SFUser>(this.client); sfApiQuery.setFrom("Users"); sfApiQuery.addQueryString("pushCreatorDefaultSettings", pushCreatorDefaultSettings); sfApiQuery.setBody(user); sfApiQuery.setHttpMethod("POST"); return sfApiQuery; }
/** * Reset Password { "NewPassword":"******", "OldPassword":"******" } { * "NewPassword":"******", "OldPassword":"******" } Resets a user password. A user can * reset his own password providing the old and new passwords. Administrators can issue this call * without providing the old password. * * @param url * @param properties * @param notify (default: false) * @return The modified user record */ public ISFQuery<SFUser> resetPassword(URI url, SFODataObject properties, Boolean notify) throws InvalidOrMissingParameterException { if (url == null) { throw new InvalidOrMissingParameterException("url"); } if (properties == null) { throw new InvalidOrMissingParameterException("properties"); } if (notify == null) { throw new InvalidOrMissingParameterException("notify"); } SFApiQuery<SFUser> sfApiQuery = new SFApiQuery<SFUser>(this.client); sfApiQuery.setFrom("Users"); sfApiQuery.setAction("ResetPassword"); sfApiQuery.addIds(url); sfApiQuery.addQueryString("notify", notify); sfApiQuery.setBody(properties); sfApiQuery.setHttpMethod("POST"); return sfApiQuery; }