IP Blocking via API Issue

861 views
Skip to first unread message

Jon

unread,
Apr 14, 2014, 3:21:25 PM4/14/14
to adwor...@googlegroups.com

I'm using the new IP blocking functionality added in V201402 (https://developers.google.com/adwords/api/docs/reference/v201402/CampaignCriterionService.IpBlock), but having an issue trying to block anything but a single IP. That link shows that we should be able to block Class C network using a mask, but I get an invalid IP address method when I try to block 70.210.9.1/24:

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ><SOAP-ENV:Header><RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201402"><clientCustomerId xmlns="https://adwords.google.com/api/adwords/cm/v201402">REDACTED</clientCustomerId><developerToken xmlns="https://adwords.google.com/api/adwords/cm/v201402">REDACTED</developerToken><userAgent xmlns="https://adwords.google.com/api/adwords/cm/v201402">REDACTED</userAgent><validateOnly xmlns="https://adwords.google.com/api/adwords/cm/v201402">false</validateOnly><partialFailure xmlns="https://adwords.google.com/api/adwords/cm/v201402">false</partialFailure></RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><mutate xmlns="https://adwords.google.com/api/adwords/cm/v201402"><operations><operator>ADD</operator><operand xsi:type="NegativeCampaignCriterion" ><campaignId>181798627</campaignId><criterion xsi:type="IpBlock" ><ipAddress>70.210.9.1/24</ipAddress></criterion></operand></operations></mutate></SOAP-ENV:Body></SOAP-ENV:Envelope>

[14 Apr 2014 18:57:31,612 - INFO ] Incoming response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201402"><requestId>0004f705416b1e980ae67d8200003d24</requestId><serviceName>CampaignCriterionService</serviceName><methodName>mutate</methodName><operations>0</operations><responseTime>309</responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>[CriterionError.INVALID_IP_ADDRESS @ operations[0].operand.criterion.ipAddress]</faultstring><detail><ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201402"><message>[CriterionError.INVALID_IP_ADDRESS @ operations[0].operand.criterion.ipAddress]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CriterionError"><fieldPath>operations[0].operand.criterion.ipAddress</fieldPath><trigger></trigger><errorString>CriterionError.INVALID_IP_ADDRESS</errorString><ApiError.Type>CriterionError</ApiError.Type><reason>UNKNOWN</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>


Plain IPs (70.210.9.1) and using a /32 (70.210.9.1/32) both work fine, which implies (along with the docs) that I should be using the format above. I also tried with 70.210.9.* as the UI uses but get the same error there.

Ideas?

Michael Cloonan (AdWords API Team)

unread,
Apr 16, 2014, 3:23:50 PM4/16/14
to adwor...@googlegroups.com
Hi,

I was also able to reproduce this, despite the documentation saying that these masks should be accepted. I'm going to file a bug for this so we can investigate further. I will update this thread when I hear more information.

Regards,
Mike, AdWords API Advisor

Yuval Haimov

unread,
Mar 31, 2015, 7:24:23 AM3/31/15
to adwor...@googlegroups.com
Any updates on that matter? 

Danial Klimkin

unread,
Mar 31, 2015, 12:00:45 PM3/31/15
to adwor...@googlegroups.com
Hello Yuval,


Did you try specifying network as A.B.C.0/24, instead of A.B.C.1/24 as in the error on this thread?


-Danial, AdWords API Team.

Yuval

unread,
Apr 2, 2015, 10:11:25 AM4/2/15
to adwor...@googlegroups.com
Hi Daniel,
I just did and it works very well.

Thanks!

Prashant Gurav

unread,
Jul 7, 2015, 9:25:34 AM7/7/15
to adwor...@googlegroups.com
Hi

I am very new to adwords api. I am PHP developer.

I want to block IP's using API, can anyone help me with script or example how I can send list of IP's to google for blocking
Reply all
Reply to author
Forward
0 new messages