// Get AdWordsUser from "~/adwords.properties".
AdWordsUser user = new AdWordsUser();
// Get the CampaignCriterionService.
CampaignCriterionServiceInterface campaignCriterionService =
user.getService(AdWordsService.V201309.CAMPAIGN_CRITERION_SERVICE);
long campaignId = Long.parseLong("INSERT_CAMPAIGN_ID_HERE");
// Create keyword.
Keyword keyword = new Keyword();
keyword.setText("jupiter cruise");
keyword.setMatchType(KeywordMatchType.BROAD);
// Create negative campaign criterion.
NegativeCampaignCriterion negativeCampaignCriterion = new NegativeCampaignCriterion();
negativeCampaignCriterion.setCampaignId(campaignId);
negativeCampaignCriterion.setCriterion(keyword);
// Create operations.
CampaignCriterionOperation operation = new CampaignCriterionOperation();
operation.setOperand(negativeCampaignCriterion);
operation.setOperator(Operator.ADD);
// Add campaign criteria.
CampaignCriterionReturnValue result =
campaignCriterionService.mutate(new CampaignCriterionOperation[] {operation});
// Display campaign criteria.
if (result != null && result.getValue() != null) {
for (CampaignCriterion campaignCriterionResult : result.getValue()) {
System.out.println("Campaign criterion with campaign id \""