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