HI all  
I want to block IP but somwhere i have 
problem at code. Can you help me please???
Here is the code

class UpdateKeyword {
const campaignId = '367448090';

 public static function runExample(AdWordsServices $adWordsServices,
      AdWordsSession $session, $campaignId) {
    $campaignCriterionService = $adWordsServices->get($session, 
CampaignCriterionService::class);
  $negativeCampaignCriterion = new 
NegativeCampaignCriterion($campaignId,"IsNegative", "IpBlock");

 $negativeCampaignCriterion->Id = "222";
  $negativeCampaignCriterion->ipAddress="10.10.10.10";
 

  // Create operations.
  $operation = new CampaignCriterionOperation();
  $operation->setoperand ($negativeCampaignCriterion);
$operation->setOperator(Operator::ADD);
    $operations[] = $operation;

  // Add campaign criteria.
    $campaignCriterion =
        $campaignCriterionService->mutate($operations)->getValue()[0];

  }

  public static function main() {
    // Generate a refreshable OAuth2 credential for authentication.
    $oAuth2Credential = (new OAuth2TokenBuilder())
        ->fromFile()
        ->build();

    // Construct an API session configured from a properties file and the 
OAuth2
    // credentials above.
    $session = (new AdWordsSessionBuilder())
        ->fromFile()
        ->withOAuth2Credential($oAuth2Credential)
        ->build();


    self::runExample(
        new AdWordsServices(), $session, intval(self::campaignId));
  }
}

UpdateKeyword::main();

thanks

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ae0e06a3-273c-4206-89a6-d6bde6af52b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • IPBLOCK Adwords... manager
    • Re: IPBLOC... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum

Reply via email to