I am trying to create new a ad_schedule for a given campaign.
Steps I have taken to achieve that:
1) Get all the existing ad_schedule criteria - working
✅ 2) Remove all ad_schedule criteria to "clear the ground" before creating new ones - working
✅3) Creation of new ad_schedule criteria - not working
❌
Sample of curl request made for the creation of new ad_schedule criteria:
--header 'Authorization: Bearer {access_token}' \
--header 'developer-token: {developer token}' \
--header 'login-customer-id: 123456789' \
--header 'Content-Type: application/json' \
--data-raw '{
"operations":[
{
"create":{
"resourceName":"customers/{customer_id}/campaignCriteria/{campaign_id}~{random_generated_id}",
"adSchedule":{
"startMinute":"{scheduleDay.startMinute}",
"endMinute":"{scheduleDay.endMinute}",
"dayOfWeek":"{scheduleDay.dayOfWeek}",
"startHour":"{scheduleDay.startHour}",
"endHour":"{scheduleDay.endHour}"
},
"status":"ENABLED",
"campaign":"{campaign_id}",
"bidModifier":1.0
}
}
]
}'
I suspect it is not working because of the incorrect
"resourceName". I was following
this guide, which instructs to set the "resourceName" as such:
customers/{customer_id}/campaignCriteria/{campaign_id}~{criterion_id}..Currently, because it's a create operation I am randomly creating the "criterion_id" as you can see in the CURL request
I also tried to set the
"resourceName" as only
"customers/{customer_id}/campaignCriteria" but it didn't work as well...
What can I be missing here?
Thanks 👍