Thanks, Marjorie, for your quick and prompt response.

Now create/remove IP works with this request data:

POST 
https://googleads.googleapis.com/v12/customers/{campaignID}/campaignCriteria:mutate
 
<https://googleads.googleapis.com/v12/customers/3930653162/campaignCriteria:mutate>
{
    "customerId": "3930653162",
    "operations": [
        {
            "remove": 
"customers/{customerID}/campaignCriteria/{campaignID}~{IP_RESOURCE_ID}"
        },
        {
            "create": {
                "ipBlock": {
                    "ip_address": "192.168.1.1"
                },
                "resourceName": 
"customers/{customerID}/campaignCriteria/{campaignID}~{IP_BLOCK_criterionID}",
                "negative": "True"
            }
        }
    ]
}

> *You may also use SET operator (for the mutate operation) to update 
existing excluded IP addresses (Which will remove existing IP addresses and 
set the new IP address to exclude provided by SET operator).*
But 

*any other code example(Perl)/online help topic for this one (SET 
operator), where I want to overwrite the existing IP? OR even a simple curl 
request could help.*Please let me know if any other information is needed 
for this question. Have a great day.

On Wednesday, 11 January, 2023 at 12:52:25 pm UTC+5:30 adsapi wrote:

> Hi Abhishek, 
>
> Thanks for reaching out to the Google Ads API Forum. I hope you are doing 
> well today.
>
> With regard to your concern, In order to block IP addresses, you may use 
> *CampaignCriterionOperation* 
> <https://developers.google.com/google-ads/api/rest/reference/rest/v12/CampaignCriterionOperation>.
>  
> You may refer to the Perl code sample in this *link* 
> <https://github.com/googleads/google-ads-perl/blob/bd072be9734437889885740aeb63bf011343900e/examples/targeting/add_campaign_targeting_criteria.pl>.
>  
> You may also use SET operator (for the mutate operation) to update existing 
> excluded IP addresses (Which will remove existing IP addresses and set the 
> new IP address to exclude provided by SET operator).
>
> See sample curl reference in campaignCriteria mutate remove operation:
>
> curl -f --request POST "
> https://googleads.googleapis.com/v12/customers/{customerID}/campaignCriteria:mutate
>  
> <https://googleads.googleapis.com/v12/customers/4985776047/campaignCriteria:mutate>"
>  
> \
> --header "Content-Type: application/json" \
> --header "developer-token: ${DEVELOPER_TOKEN}" \
> --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \
> --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
> --data "{
>    "operations" : [
>       {
>         "remove" : 
> "customers/{customerID}/campaignCriteria/{campaignID}~{criterionID}"
>       }
>    ] 
> }"
>
> Please let me know if you have further concerns. Have a great day.
>
> Regards,
> [image: Google Logo] 
> Marjorie 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2hx0Bk:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/f38c3663-b31b-4060-bfb5-29af4500ada7n%40googlegroups.com.
  • No... Abhishek Bhasker
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Abhishek Bhasker
        • ... Abhishek Bhasker
          • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to