code: public Boolean assignRoleToUser(long id, List<Long> roleIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
  		cleanError();
  		prepareToken();
  
  		OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
  		OAuthClient oAuthClient = new OAuthClient(httpClient);
  
  		URIBuilder url = new URIBuilder(settings.getURL(Constants.ADD_ROLE_TO_USER_URL, Long.toString(id)));
  		OAuthClientRequest bearerRequest = new OAuthBearerClientRequest(url.toString())
  			.buildHeaderMessage();
  
  		Map<String, String> headers = getAuthorizedHeader();
  		bearerRequest.setHeaders(headers);
  
  		HashMap<String, Object> params = new HashMap<String, Object>();
  		params.put("role_id_array", roleIds);
  
  		String body = JSONUtils.buildJSON(params);
  		bearerRequest.setBody(body);
  
  		Boolean success = true;
  		OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient.resource(bearerRequest, OAuth.HttpMethod.PUT, OneloginOAuthJSONResourceResponse.class);
  		if (oAuthResponse.getResponseCode() != 200) {
  			success = false;
  			error = oAuthResponse.getError();
  			errorDescription = oAuthResponse.getErrorDescription();
  			errorAttribute = oAuthResponse.getErrorAttribute();
  		}
  
  		return success;
  	}
docs: Assigns Role to User
  
  @param id
  Id of the user to be modified
  @param roleIds
  Set to an array of one or more role IDs.
  
  @return true if success
  
  @throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
  @throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
  @throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor
  
  @see <a target="_blank" href="https://developers.onelogin.com/api-docs/1/users/assign-role-to-user">Assign Role to User documentation</a>