src/org/ohmage/lib/OhmageApi.java
public void createUser(final String authenticationToken, 
			final String client,
			final String newUsername, final String newPassword,
			final Boolean admin, final Boolean enabled,
			final Boolean newAccount, final Boolean canCreateCampaigns) 
			throws ApiException, RequestErrorException {
		
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put(InputKeys.AUTH_TOKEN, authenticationToken);
		parameters.put(InputKeys.CLIENT, client);
		parameters.put(InputKeys.USERNAME, newUsername);
		parameters.put(InputKeys.PASSWORD, newPassword);
		parameters.put(InputKeys.USER_ADMIN, admin);
		parameters.put(InputKeys.USER_ENABLED, enabled);
		parameters.put(InputKeys.NEW_ACCOUNT, newAccount);
		parameters.put(InputKeys.CAMPAIGN_CREATION_PRIVILEGE, canCreateCampaigns);
		
		try {
			makeRequest(
					new URL(url.toString() + RequestBuilder.getInstance().getApiUserCreate()),
					parameters,
					false
				);
		}
		catch(MalformedURLException e) {
			throw new ApiException("The URL was incorrectly created.", e);
		}
		catch(IllegalArgumentException e) {
			throw new ApiException("The response was not proper JSON.", e);
		}
	}
/**
	 * Creates a new user. The requesting user must be an admin.
	 * 
	 * @param authenticationToken The requesting user's authentication token.
	 * 
	 * @param client The client value.
	 * 
	 * @param newUsername The username for the new user.
	 * 
	 * @param newPassword The plaintext password for the new user.
	 * 
	 * @param admin Whether or not the new user should be an admin.
	 * 
	 * @param enabled Whether or not the new user's account should be enabled.
	 * 
	 * @param newAccount Whether or not the new user must change their password
	 * 					 before they can login. This is optional and defaults 
	 * 					 to true. Optional.
	 * 
	 * @param canCreateCampaigns Whether or not the new user is allowed to 
	 * 							 create campaigns. This is optional and 
	 * 							 defaults to however the server is configured.
	 * 							 Optional.
	 * 
	 * @throws ApiException Thrown if there is a library error.
	 * 
	 * @throws RequestErrorException Thrown if the server returns an error.
	 */
Creates a new user. The requesting user must be an admin.

@param authenticationToken The requesting user's authentication token.

@param client The client value.

@param newUsername The username for the new user.

@param newPassword The plaintext password for the new user.

@param admin Whether or not the new user should be an admin.

@param enabled Whether or not the new user's account should be enabled.

@param newAccount Whether or not the new user must change their password
before they can login. This is optional and defaults
to true. Optional.

@param canCreateCampaigns Whether or not the new user is allowed to
create campaigns. This is optional and
defaults to however the server is configured.
Optional.

@throws ApiException Thrown if there is a library error.

@throws RequestErrorException Thrown if the server returns an error.
Creates a new user . The requesting user must be an admin . @param authenticationToken The requesting user ' s authentication token . @param client The client value . @param newUsername The username for the new user . @param newPassword The plaintext password for the new user . @param admin Whether or not the new user should be an admin . @param enabled Whether or not the new user ' s account should be enabled . @param newAccount Whether or not the new user must change their password before they can login . This is optional and defaults to true . Optional . @param canCreateCampaigns Whether or not the new user is allowed to create campaigns . This is optional and defaults to however the server is configured . Optional . @throws ApiException Thrown if there is a library error . @throws RequestErrorException Thrown if the server returns an error .
public void createUser(final String authenticationToken, 
			final String client,
			final String newUsername, final String newPassword,
			final Boolean admin, final Boolean enabled,
			final Boolean newAccount, final Boolean canCreateCampaigns) 
			throws ApiException, RequestErrorException {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put(InputKeys.AUTH_TOKEN, authenticationToken);
		parameters.put(InputKeys.CLIENT, client);
		parameters.put(InputKeys.USERNAME, newUsername);
		parameters.put(InputKeys.PASSWORD, newPassword);
		parameters.put(InputKeys.USER_ADMIN, admin);
		parameters.put(InputKeys.USER_ENABLED, enabled);
		parameters.put(InputKeys.NEW_ACCOUNT, newAccount);
		parameters.put(InputKeys.CAMPAIGN_CREATION_PRIVILEGE, canCreateCampaigns);
		try {
			makeRequest(
					new URL(url.toString() + RequestBuilder.getInstance().getApiUserCreate()),
					parameters,
					false
				);
		}
		catch(MalformedURLException e) {
			throw new ApiException("The URL was incorrectly created.", e);
		}
		catch(IllegalArgumentException e) {
			throw new ApiException("The response was not proper JSON.", e);
		}
	}
public void createUser ( final String authenticationToken , final String client , final String newUsername , final String newPassword , final Boolean admin , final Boolean enabled , final Boolean newAccount , final Boolean canCreateCampaigns ) throws ApiException , RequestErrorException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( InputKeys . AUTH_TOKEN , authenticationToken ) ; parameters . put ( InputKeys . CLIENT , client ) ; parameters . put ( InputKeys . USERNAME , newUsername ) ; parameters . put ( InputKeys . PASSWORD , newPassword ) ; parameters . put ( InputKeys . USER_ADMIN , admin ) ; parameters . put ( InputKeys . USER_ENABLED , enabled ) ; parameters . put ( InputKeys . NEW_ACCOUNT , newAccount ) ; parameters . put ( InputKeys . CAMPAIGN_CREATION_PRIVILEGE , canCreateCampaigns ) ; try { makeRequest ( new URL ( url . toString ( ) + RequestBuilder . getInstance ( ) . getApiUserCreate ( ) ) , parameters , false ) ; } catch ( MalformedURLException e ) { throw new ApiException ( "The URL was incorrectly created." , e ) ; } catch ( IllegalArgumentException e ) { throw new ApiException ( "The response was not proper JSON." , e ) ; } }
Creates a new user.
Creates a new user .