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 ✅ 
<https://emojipedia.org/check-mark-button/#:~:text=%E2%9C%85%20Check%20Mark%20Button&text=Shows%20on%20most%20platforms%20with,blue%20check%20mark%20%2F%20blue%20tick.&text=Check%20Mark%20Button%20was%20approved,to%20Emoji%201.0%20in%202015.>
 
2) Remove all ad_schedule criteria to "clear the ground" before creating 
new ones  - working ✅ 
<https://emojipedia.org/check-mark-button/#:~:text=%E2%9C%85%20Check%20Mark%20Button&text=Shows%20on%20most%20platforms%20with,blue%20check%20mark%20%2F%20blue%20tick.&text=Check%20Mark%20Button%20was%20approved,to%20Emoji%201.0%20in%202015.>
3) Creation of new ad_schedule criteria - not working ❌ 
<https://emojipedia.org/cross-mark/> 

*Guides I am following: *
https://developers.google.com/google-ads/api/reference/rpc/v6/CampaignCriterion
https://developers.google.com/google-ads/api/reference/rpc/v6/AdScheduleInfo

*Sample of curl request made for the creation of new ad_schedule criteria: *

*curl --location -g --request POST 
'https://googleads.googleapis.com/v6/customers/{customer_id}/campaignCriteria:mutate'
 
\*
*--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 
<https://developers.google.com/google-ads/api/reference/rpc/v6/CampaignCriterion>,
 
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 👍


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"AdWords API and Google Ads 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/f4f744dc-24de-40b6-85c7-f56d21733360n%40googlegroups.com.

Reply via email to