Removing adschedule in REST API using campaign criterion id's

43 views
Skip to first unread message

Eylon Raymond Harari

unread,
Feb 1, 2021, 10:04:11 AM2/1/21
to AdWords API and Google Ads API Forum
Im trying to remove all ad schedule criterions from a campaign using the REST API. 

1. This is a sample data shape of how the schedule criterions / resources look like:

[
   {
      "campaignCriterion":{
         "resourceName":"customers/XXX_customer_id_XXX/campaignCriteria/XXX_campaign_id_XXX~123456",
         "adSchedule":{
            "startMinute":"ZERO",
            "endMinute":"ZERO",
            "dayOfWeek":"MONDAY",
            "startHour":8,
            "endHour":23
         }
      }
   },
   {
      "campaignCriterion":{
         "resourceName":"customers/XXX_customer_id_XXX/campaignCriteria/XXX_campaign_id_XXX~123456",
         "adSchedule":{
            "startMinute":"ZERO",
            "endMinute":"ZERO",
            "dayOfWeek":"TUESDAY",
            "startHour":8,
            "endHour":23
         }
      }
   }
]

2. I am following this guide: 

3. Now, this is the CURL request I'm making - 

--header 'Authorization: Bearer {access_token...}' \
--header 'developer-token: {developer_token...}' \
--header 'Content-Type: application/json' \
--data-raw '{
"operations":[
{
"remove":{
"resourceName":"customers/XXX_customer_id_XXX/campaignCriteria/XXX_campaign_id_XXX~XXX_crieteria_id_XXX"
}
},
{
"remove":{
"resourceName":"customers/XXX_customer_id_XXX/campaignCriteria/XXX_campaign_id_XXX~XXX_crieteria_id_XXX"
}
}
]
}'


I get a 400 "bad request" response from google. 

How can I make it work? for me, it seems like I am following the guidelines seen in point #1 (following the shape of the data) and also from the link in #2. 

Surely I'm missing something, will appreciate a solution or code sample..

Cheers 

Google Ads API Forum Advisor Prod

unread,
Feb 2, 2021, 12:39:46 AM2/2/21
to eyl...@gmail.com, adwor...@googlegroups.com
Hi Eylon,

You can refer to this guide on how you can construct your mutate requests using REST.

For additional information, you can also refer to our design and discovery documents.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2BchSM:ref

Eylon Raymond Harari

unread,
Feb 2, 2021, 11:51:29 PM2/2/21
to AdWords API and Google Ads API Forum
Thanks, all working
Reply all
Reply to author
Forward
0 new messages