src/org/ohmage/lib/OhmageApi.java
public void createCampaign(final String authenticationToken, 
			final String client, final Campaign.RunningState runningState, 
			final Campaign.PrivacyState privacyState,
			final Collection<String> classIds, final String xml,
			final String description) 
			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.RUNNING_STATE, runningState);
		parameters.put(InputKeys.PRIVACY_STATE, privacyState);
		
		if(classIds != null) {
			parameters.put(InputKeys.CLASS_URN_LIST, StringUtils.collectionToStringList(classIds, InputKeys.LIST_ITEM_SEPARATOR));
		}
		
		parameters.put(InputKeys.XML, xml);
		parameters.put(InputKeys.DESCRIPTION, description);
		
		try {
			makeRequest(
					new URL(url.toString() + RequestBuilder.getInstance().getApiCampaignCreate()), 
					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 campaign.
	 * 
	 * @param authenticationToken The user's authentication token.
	 * 
	 * @param client The client value.
	 * 
	 * @param runningState The initial running state for this campaign.
	 * 
	 * @param privacyState The initial privacy state for this campaign.
	 *  
	 * @param classIds The IDs for the classes to associate with this campaign.
	 * 
	 * @param xml The campaign's XML.
	 * 
	 * @param description The campaign's description. Optional.
	 * 
	 * @throws ApiException Thrown if there is a library error.
	 * 
	 * @throws RequestErrorException Thrown if the server returns an error.
	 */
Creates a campaign.

@param authenticationToken The user's authentication token.

@param client The client value.

@param runningState The initial running state for this campaign.

@param privacyState The initial privacy state for this campaign.

@param classIds The IDs for the classes to associate with this campaign.

@param xml The campaign's XML.

@param description The campaign's description. Optional.

@throws ApiException Thrown if there is a library error.

@throws RequestErrorException Thrown if the server returns an error.
Creates a campaign . @param authenticationToken The user ' s authentication token . @param client The client value . @param runningState The initial running state for this campaign . @param privacyState The initial privacy state for this campaign . @param classIds The IDs for the classes to associate with this campaign . @param xml The campaign ' s XML . @param description The campaign ' s description . Optional . @throws ApiException Thrown if there is a library error . @throws RequestErrorException Thrown if the server returns an error .
public void createCampaign(final String authenticationToken, 
			final String client, final Campaign.RunningState runningState, 
			final Campaign.PrivacyState privacyState,
			final Collection<String> classIds, final String xml,
			final String description) 
			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.RUNNING_STATE, runningState);
		parameters.put(InputKeys.PRIVACY_STATE, privacyState);
		if(classIds != null) {
			parameters.put(InputKeys.CLASS_URN_LIST, StringUtils.collectionToStringList(classIds, InputKeys.LIST_ITEM_SEPARATOR));
		}
		parameters.put(InputKeys.XML, xml);
		parameters.put(InputKeys.DESCRIPTION, description);
		try {
			makeRequest(
					new URL(url.toString() + RequestBuilder.getInstance().getApiCampaignCreate()), 
					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 createCampaign ( final String authenticationToken , final String client , final Campaign . RunningState runningState , final Campaign . PrivacyState privacyState , final Collection < String > classIds , final String xml , final String description ) 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 . RUNNING_STATE , runningState ) ; parameters . put ( InputKeys . PRIVACY_STATE , privacyState ) ; if ( classIds != null ) { parameters . put ( InputKeys . CLASS_URN_LIST , StringUtils . collectionToStringList ( classIds , InputKeys . LIST_ITEM_SEPARATOR ) ) ; } parameters . put ( InputKeys . XML , xml ) ; parameters . put ( InputKeys . DESCRIPTION , description ) ; try { makeRequest ( new URL ( url . toString ( ) + RequestBuilder . getInstance ( ) . getApiCampaignCreate ( ) ) , 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 campaign.
Creates a campaign .