Hi John,
Thank you for reaching out. I'm afraid that blocking IP addresses or getting all blocked IP's isn't currently possible with the API. However, to better assist you, could you elaborate what do you need to achieve using the Google Ads API? If you wish to use cURL to interact with the API, you may refer to this guide as to how.
Regards,
Dave
Google Ads API Team
If you wanted to call the CampaignBudgetService.MutateCampaignBudgets method with an HTTP POST, you would transform that URL to
/v1/customers/{customer_id}/campaignBudgets:mutate
Hi John,
My apologies as I may have overlooked this. Upon checking with the team, excluding IP addresses is indeed possible using the IpBlockInfo field. As per your other concern, I would need to discuss this with the team. I will provide you updates once available.
Regards,
Dave
Google Ads API Team
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.ads.googleads.v1.errors.GoogleAdsFailure",
"errors": [
{
"errorCode": {
"criterionError": "CANNOT_ADD_CRITERIA_TYPE"
},
"message": "Criteria type can not be targeted.",
"trigger": {
"stringValue": ""
},
"location": {
"fieldPathElements": [
{
"fieldName": "operations",
"index": "0"
},
{
"fieldName": "create"
},
{
"fieldName": "ip_block"
}
]
}
}
]
}
]
}
}
{
"query": "SELECT campaign.id, campaign.name, campaign.status, campaign.serving_status, campaign_criterion.criterion_id, campaign_criterion.type FROM campaign_criterion WHERE campaign_criterion.type='IP_BLOCK'"
}
{
"campaign": {
"resourceName": "customers/CUSTOMER_ID/campaigns/CAMPAIGN_ID",
"id": "CAMPAIGN_ID",
"name": "Display-1",
"status": "ENABLED",
"servingStatus": "SERVING"
},
"campaignCriterion": {
"resourceName": "customers/CUSTOMER_ID/campaignCriteria/CAMPAIGN_ID~CRITERION_ID",
"criterionId": "CRITERION_ID",
"type": "IP_BLOCK"
}
}