Re: Create ad schedule bug

2021-03-09 Thread Eylon Raymond Harari
Sent, thanks

On Wednesday, March 10, 2021 at 4:35:50 AM UTC+10 adsapiforumadvisor wrote:

> Hi Eylon,
>
> Please email us at googleadsapi-supp...@google.com if you are unable to 
> reply privately.
>
> Cheers,
> Anthony
>
> [image: Google Logo] 
> Anthony 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2DJEn7: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 
"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/f7a57572-f215-47ef-886d-422f3d86af32n%40googlegroups.com.


Re: Create ad schedule bug

2021-03-08 Thread Eylon Raymond Harari
Hey peter, the option for replying to the author is not available for me... 
I there another address I can send the details to? 

On Tuesday, March 9, 2021 at 12:00:35 PM UTC+10 adsapiforumadvisor wrote:

> Hi Eylon,
>
> Unfortunately, since node.js is not supported directly, then our team does 
> not have visibility on how logging can be enabled for it. However, your API 
> transaction should still return a response, and within that response the 
> request-id 
> 
>  
> should be included. That said, could you provide the following instead : 
>
>- your customer ID 
>- complete node.js request 
>- response returned by your API transaction including the request-id 
>- generated IDs of your ad schedule criterion 
>
> You may send these details using the *Reply privately to author* option
>
>
> Best regards,
>
> [image: Google Logo] 
> Peter Laurence Napa Oliquino 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2DJEn7: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 
"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/8205a904-8468-4410-bb76-e5511a6ac896n%40googlegroups.com.


Re: Create ad schedule bug

2021-03-06 Thread Eylon Raymond Harari
Hi Peter, I am not using any of the client's libraries - its all on nodejs 
with the raw google ads API.

However, my project is hosted on the google app engine so maybe that's 
something you can access. 

How do you reckon we can proceed from here? 

On Friday, March 5, 2021 at 11:41:50 AM UTC+10 adsapiforumadvisor wrote:

> Hi Eylon,
>
> I work with Matt and allow me to assist you.
>
> Thank you for sharing these details. However, so our team can further 
> investigate the behavior that you are observing, could you access this 
> link  then 
> enable logging by navigating to the *Client libraries > Your client 
> library (ex. Java) > Logging* documentation?
>
> Once enabled, you may send our customer ID and the complete request 
> 
>  
> and response 
> 
>  
> logs, with the request-id 
> .
>  
> You may send the requested details using the *Reply privately to author* 
> option.
>
> Best regards,
>
> [image: Google Logo] 
> Peter Laurence Napa Oliquino 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2DJEn7: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 
"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/b9a6b82f-646e-40b5-9b1b-0d7fdd8c3fc4n%40googlegroups.com.


Re: Create ad schedule bug

2021-03-03 Thread Eylon Raymond Harari

Hi Matt, Ill share some of the curl requests, responses and outcomes to 
better explain the situation. 

* Please look at the operations directed at "SUNDAY", which will be 
highlighted in blue. 

The first request is showing the expected behavior, the second request will 
showcase the bug -

*Request 1: *

curl --location --request POST 
'https://googleads.googleapis.com/v6/customers/{customerid}/campaignCriteria:mutate'
 
\
--header 'Authorization: Bearer {token}' \
--header 'developer-token: {developer-token}' \
--header 'login-customer-id: {customerid}' \
--header 'Content-Type: application/json' \
--data-raw '{
"operations": [
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "MONDAY",
"startHour": 8,
"endHour": 22
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "TUESDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "WEDNESDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "THURSDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "FIFTEEN",
"dayOfWeek": "FRIDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "SATURDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
* {*
*"create": {*
*"adSchedule": {*
*"startMinute": "ZERO",*
*"endMinute": "THIRTY",*
*"dayOfWeek": "SUNDAY",*
*"startHour": 5,*
*"endHour": 23*
* },*
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
}
]
}'

*Request 1 response: *

{ results:

   [ { resourceName: 
'customers/{customer-id}/campaignCriteria/{campaign-id}~{creteria-id}' },

{ 
resourceName: 
'customers/{customer-id}/campaignCriteria/{campaign-id}~{creteria-id}' },

 { 
resourceName: 
'customers/{customer-id}/campaignCriteria/{campaign-id}~{creteria-id}' },

 { 
resourceName: 
'customers/{customer-id}/campaignCriteria/{campaign-id}~{creteria-id}' },

 { 
resourceName: 
'customers/{customer-id}/campaignCriteria/{campaign-id}~{creteria-id}' },

 { 
resourceName: 
'customers/{customer-id}/campaignCriteria/{campaign-id}~{creteria-id}' },

 { 
resourceName: 
'customers/{customer-id}/campaignCriteria/{campaign-id}~{creteria-id}' }
]}


*Request 1 outcome: *
Sunday: 05:00 - 23:30 = as expected

--

*Request 2: *

curl --location --request POST 
'https://googleads.googleapis.com/v6/customers/{customerid}/campaignCriteria:mutate'
 \
--header 'Authorization: Bearer {token}' \
--header 'developer-token: {developer-token}' \
--header 'login-customer-id: {customerid}' \
--header 'Content-Type: application/json' \
--data-raw '{
"operations": [
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "MONDAY",
"startHour": 8,
"endHour": 22
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "TUESDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "WEDNESDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "THURSDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "FIFTEEN",
"dayOfWeek": "FRIDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
{
"create": {
"adSchedule": {
"startMinute": "ZERO",
"endMinute": "ZERO",
"dayOfWeek": "SATURDAY",
"startHour": 5,
"endHour": 23
},
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
},
*{*
*"create": {*
*"adSchedule": {*
*"startMinute": "ZERO",*
*"endMinute": "FORTY_FIVE",*
*"dayOfWeek": "SUNDAY",*
*"startHour": 5,*
*"endHour": 23*
*},*
"campaign": "customers/{customer-id}/campaigns/{campaign-id}",
"bidModifier": 1
}
}
]
}'

*Request 2 response: *

{ results:

   [ { 
resourceName: 
'customers/{customer-id}/campaignCriteria/{campaign-id}~{creteria-id}' },

 

Create ad schedule bug

2021-02-26 Thread Eylon Raymond Harari
Ad schedule cannot be updated for a 45 minute timeframe. 

0, 15, 30 minutes works fine. When I add "FORTY_FIVE" in 
startMinute/endMinute it rounds it back to 0 (see examples below)

Refference: 

Endpoint:
*https://googleads.googleapis.com/v6/customers/{customerid}/campaignCriteria:mutate*

Example operations and results: 


*1. *Works as expected, the result is:* WEDNESDAY: 20:15-23:15*

{

   "create":{

  "adSchedule":{

 "startMinute":"FIFTEEN",

 "endMinute":"FIFTEEN",

 "dayOfWeek":"WEDNESDAY",

 "startHour":20,

 "endHour":23

  },

  "campaign":"customers/{customerid}/campaigns/{campaignid}",

  "bidModifier":1

   }

}


*2. *Not Working as expected, the result is:* WEDNESDAY: 20:15-23:00, 
instead of the expected **WEDNESDAY: 20:15-23:45*

{

   "create":{

  "adSchedule":{

 "startMinute":"FIFTEEN",

 "endMinute":"FORTY_FIVE",

 "dayOfWeek":"WEDNESDAY",

 "startHour":20,

 "endHour":23

  },

  "campaign":"customers/{customerid}/campaigns/{campaignid}",

  "bidModifier":1

   }

}


Additional information - 

- The bug occurs every hour of the day I try

- I don't get any error message after the request

- When choosing "FORTY_FIVE" it rounds it down to "ZERO" every time

- Everything else (all minute and hour options) works perfectly. 


How can I solve this issue? 

Cheers 


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/4b29d475-b471-4098-9f55-4d78af5ea999n%40googlegroups.com.


Re: Creating ad_schedule using rest API with the campaignCriteria service

2021-02-03 Thread Eylon Raymond Harari
Its working now - 

This is the correct payload: 

*{*
*   "operations":[*
*  {*
* "create":{*

*"adSchedule":{*
*   "startMinute":"{scheduleDay.startMinute}",*
*   "endMinute":"{scheduleDay.endMinute}",*
*   "dayOfWeek":"{scheduleDay.dayOfWeek}",*
*   "startHour":"{scheduleDay.startHour}",*
*   "endHour":"{scheduleDay.endHour}"*
*},*
*"status":"ENABLED",*

*"campaign":"customers/{customer_id}/campaigns/{campaign_id}",*
*"bidModifier":1.0*
* }*
*  }*
*   ]*
*}*

*campaign *needs to be in in *"customers/{customer_id}/campaigns/{campaign_id}" 
*format, and not only the *campaign ID*

On Thursday, February 4, 2021 at 10:41:18 AM UTC+10 Eylon Raymond Harari 
wrote:

> Hi, thanks for the tip 
>
> I tried again like this:
>
> *curl --location -g --request POST 
> 'https://googleads.googleapis.com/v6/customers/{customer_id}/campaignCriteria:mutate
>  
> <https://googleads.googleapis.com/v6/customers/%7Bcustomer_id%7D/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":{*
> *"adSchedule":{*
> *   "startMinute":"{scheduleDay.startMinute}",*
> *   "endMinute":"{scheduleDay.endMinute}",*
> *   "dayOfWeek":"{scheduleDay.dayOfWeek}",*
> *   "startHour":"{scheduleDay.startHour}",*
> *   "endHour":"{scheduleDay.endHour}"*
> *},*
> *"status":"ENABLED",*
> *"campaign":"{campaign_id}",*
> *"bidModifier":1.0*
> * }*
> *  }*
> *   ]*
> *}*
>
>
> And it still doesn't work.. 
>
> Would appreciate other ideas of how to solve that  
> On Thursday, February 4, 2021 at 7:01:03 AM UTC+10 adsapiforumadvisor 
> wrote:
>
>> Hi Eylon,
>>
>> Thank you for reaching out. When you create a new CampaignCriterion, you 
>> are not supposed to add resourceName in the operations. Please remove the 
>> "campaignCriterion":"customers/{customer_id}/campaignCriteria/{campaign_id}~{random_generated_id}"
>>  
>> and try it again.
>>
>> Thanks and regards,
>> Xiaoming, Google Ads API Team
>>  
>> [image: Google Logo] 
>> Xiaoming 
>> Google Ads API Team 
>>   
>>
>> ref:_00D1U1174p._5004Q2BdL8k: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 
"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/49760df0-9a07-49cb-956f-6d812bcc0aban%40googlegroups.com.


Re: Creating ad_schedule using rest API with the campaignCriteria service

2021-02-03 Thread Eylon Raymond Harari
Hi, thanks for the tip 

I tried again like this:

*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":{*
*"adSchedule":{*
*   "startMinute":"{scheduleDay.startMinute}",*
*   "endMinute":"{scheduleDay.endMinute}",*
*   "dayOfWeek":"{scheduleDay.dayOfWeek}",*
*   "startHour":"{scheduleDay.startHour}",*
*   "endHour":"{scheduleDay.endHour}"*
*},*
*"status":"ENABLED",*
*"campaign":"{campaign_id}",*
*"bidModifier":1.0*
* }*
*  }*
*   ]*
*}*


And it still doesn't work.. 

Would appreciate other ideas of how to solve that  
On Thursday, February 4, 2021 at 7:01:03 AM UTC+10 adsapiforumadvisor wrote:

> Hi Eylon,
>
> Thank you for reaching out. When you create a new CampaignCriterion, you 
> are not supposed to add resourceName in the operations. Please remove the 
> "campaignCriterion":"customers/{customer_id}/campaignCriteria/{campaign_id}~{random_generated_id}"
>  
> and try it again.
>
> Thanks and regards,
> Xiaoming, Google Ads API Team
>  
> [image: Google Logo] 
> Xiaoming 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2BdL8k: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 
"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/13ae8260-83fb-4f2b-bdc5-5cceee7d4a97n%40googlegroups.com.


Re: Creating ad_schedule using rest API with the campaignCriteria service

2021-02-02 Thread Eylon Raymond Harari
Edit: I have found this key point: 
"Key Point: Create operations don't specify a resourceName or ID. When the 
API call succeeds, the response includes the resourceName generated for the 
newly created object." in this 
guide 
https://developers.google.com/google-ads/api/docs/rest/common/mutate#create

So the new request looks like this after changing *resourceName *to 
*campaignCriterion*
*curl --location -g --request POST 
'https://googleads.googleapis.com/v6/customers/{customer_id}/campaignCriteria:mutate
 
<https://googleads.googleapis.com/v6/customers/%7Bcustomer_id%7D/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":{*
*
"campaignCriterion":"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 also made the request with a few variations to fish out if I had a typo: 
*1- 
"campaignCriterion":"customers/{customer_id}/campaignCriteria/{campaign_id}~{random_generated_id}"*
*2- "campaignCriterion":"customers/{customer_id}/campaignCriteria"*
*3- "**campaignCriteria*
*":"customers/{customer_id}/campaignCriteria/{campaign_id}~{random_generated_id}"*
*4- "**campaignCriteria**":"customers/{customer_id}/campaignCriteria"*

The operation still does not work after these edits 



On Wednesday, February 3, 2021 at 3:03:03 PM UTC+10 Eylon Raymond Harari 
wrote:

> 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=Shows%20on%20most%20platforms%20with,blue%20check%20mark%20%2F%20blue%20tick.=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=Shows%20on%20most%20platforms%20with,blue%20check%20mark%20%2F%20blue%20tick.=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
>  
> <https://googleads.googleapis.com/v6/customers/%7Bcustomer_id%7D/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 becau

Creating ad_schedule using rest API with the campaignCriteria service

2021-02-02 Thread Eylon Raymond Harari
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 ❌ 
 

*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 
,
 
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.


Re: Removing adschedule in REST API using campaign criterion id's

2021-02-02 Thread Eylon Raymond Harari
Thanks, all working
On Tuesday, February 2, 2021 at 3:39:46 PM UTC+10 adsapiforumadvisor wrote:

> 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,
>
> [image: Google Logo] 
> Peter Laurence Napa Oliquino 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2BchSM: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 
"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/63615462-0277-43fc-b00b-dd45895090cen%40googlegroups.com.


Removing adschedule in REST API using campaign criterion id's

2021-02-01 Thread Eylon Raymond Harari
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: *
https://developers.google.com/google-ads/api/reference/rpc/v6/CampaignCriterionOperation#remove

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

*curl --location --request POST 
'https://googleads.googleapis.com/v6/customers/XXX_customer_id_XXX/campaignCriteria:mutate'
 
\*
*--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 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/562f0ddf-3de6-4fc1-9550-b821985b2b11n%40googlegroups.com.


Re: Update/Mutate campaign budget using REST API

2021-01-28 Thread Eylon Raymond Harari
Works great, thanks for the help!

On Thursday, January 28, 2021 at 6:48:13 AM UTC+10 adsapiforumadvisor wrote:

> Hi Eylon,
>
> Thank you for reaching out. Please give it a try to the following code:
>  
>
> curl --request POST \
>
>  --header "Content-Type: application/json" \
>
>  --header "Authorization: Bearer ACCESS TOKEN" \
>
>  --header "developer-token: DEVELOPER TOKEN" \
>
>  --data @update_budget.json \
>
>  
> https://googleads.googleapis.com/v6/customers/1234567890/campaignBudgets:mutate
>   
>
> {
>
>   "operations": [
>
> {
>
>   "updateMask": "amount_micros",
>
>   "update": {
>
> "resourceName": "customers/1234567890/campaignBudgets/11",
>
> “amount_micros”: "6000"
>
>   }
>
> }
>
>   ]
>
> }
>   
>
> Thanks and regards,
> Xiaoming, Google Ads API Team
>  
> [image: Google Logo] 
> Xiaoming 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2B3hNK: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 
"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/633780c4-2b21-435e-a172-60e92d2c1158n%40googlegroups.com.


Update/Mutate campaign budget using REST API

2021-01-26 Thread Eylon Raymond Harari
Im trying to update campaign budgets using the rest api. 

This has been working successfully for other operations, such as updating 
the campaign status, name, etc.. 

I'll provide a few examples here of the types of "payloads" I have been 
using. 



*1. Updating campaign status (that one works fine):*
*{*
*operations: [{*
*updateMask: 'status',*
*update: {*
*resourceName: 
`customers/${user.customer_id}/campaigns/${campaignId}`,*
*status,*
*},*
*}, ],*
*};*



*2. Updating campaign budget (that one does not work)*
*{*
*operations: [{*
*updateMask: 'amountMicros',*
*update: {*
*resourceName: 
`customers/${customer_id}/campaignBudgets/${budget_id}`,*
*amountMicros: '7',*
*},*
*}, ],*
*};*


*3. For more context, I will share a sample response when fetching this 
data:*

*[{results: [{campaign: {resourceName: 
'customers/X-XX/campaigns/X-XX',status: 
'ENABLED',name: 'X-XX',id: 'X-XX',  
  },metrics: {clicks: '0',conversions: 
0,costMicros: '0',impressions: '0',},  
  campaignBudget: {resourceName: 
'customers/X-XX/campaignBudgets/X-XX',
amountMicros: '7',},}, ],fieldMask: 
'campaign.id,campaign.name,campaign.status,campaignBudget.amountMicros,metrics.impressions,metrics.clicks,metrics.ctr,metrics.averageCpc,metrics.conversions,metrics.costMicros,metrics.averageCpc',},
 
];*

As you can see I have been trying to make the update/mutate requests while 
following the data shape seen in figure 3 - but with no success. 

Would appreciate if someone can share a solution or a code sample for this 
one, 

Cheers

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/870ead23-d9c8-4f78-903c-a37a29e417b2n%40googlegroups.com.


Re: Service account and Google Ads Api

2021-01-05 Thread Eylon Raymond Harari
I had the exact same problem - NOT_ADS_USER 

If you indeed completed all the prerequisites 

 and 
the succeeding steps 
,
 
including this section 
,
 
and still have the error - 
the problem might be that you are creating the access_token in the wrong 
way. Try using this code (it's in nodejs but easily applied in all 
languages) 

*const private_key = require('./key.json').private_key;*
*const token = jwt.sign(*
*{*
*iss:*
*SERVICE_ACCOUNT_EMAIL,*
*sub: GOOGLE_MMC_MANAGER_EMAIL,*
*scope: 'https://www.googleapis.com/auth/adwords 
',*
*aud: 'https://oauth2.googleapis.com/token 
',*

*exp: Math.round(Date.now() / 1000) + 3600,*
*iat: Math.round(Date.now() / 1000),*
*},*
*private_key,*
*{ algorithm: 'RS256' },*
*);*

*// console.log(token);*

*try {*
*const response = await http.post 
('https://oauth2.googleapis.com/token 
', {*
*grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',*
*assertion: token,*
*});*
*const access_token = response.data;*
*console.log(access_token);*
*} catch (error) {*

*console.log(error.data);*
*}*
*};*

*// Make an authorized request with the access_token*

hope it will help as it helped me

On Wednesday, October 7, 2020 at 1:43:48 PM UTC+10 adsapiforumadvisor wrote:

> Hi Thijs,
>
> The NOT_ADS_USER should point to an issue with user that was logged in 
> while creating the service account. Errors related to the developer token 
> and customerID should return a different error.
>
> Moving forward, could you also confirm if all the prerequisites 
> 
>  
> and the succeeding steps 
> ,
>  
> including this section 
> ,
>  
> were completed correctly when you generated your service account 
> credentials?
>
> If all requirements and steps were followed and you continue to encounter 
> the issue, you may send all the private details such as the complete 
> request and response logs, your customer ID, and the user (email address) 
> that you used to generate your service account, to our support alias (
> googleadsa...@google.com), so we can discuss in private.
>
>
> Best regards,
>
> [image: Google Logo] 
> Peter Laurence Napa Oliquino 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q25Z2u8: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 
"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/af78c754-76bb-4b0d-b354-101fc0de2fb4n%40googlegroups.com.


Re: Using Service account [HTTP error 401]: “Request had invalid authentication credentials. Expected OAuth 2 access token…”

2021-01-05 Thread Eylon Raymond Harari
** SOLVED *** !!!

Now it's all working. 

Turns out I was not creating the token precisely the correct way. 

Here's a sample of the code I use to generate the correct access token in 
*NodeJs*:

const private_key = require('./key.json').private_key;
const token = jwt.sign(
{
iss:
SERVICE_ACCOUNT_EMAIL,
sub: GOOGLE_MMC_MANAGER_EMAIL,
scope: 'https://www.googleapis.com/auth/adwords',
aud: 'https://oauth2.googleapis.com/token',
exp: Math.round(Date.now() / 1000) + 3600,
iat: Math.round(Date.now() / 1000),
},
private_key,
{ algorithm: 'RS256' },
);

// console.log(token);

try {
const response = await http.post('https://oauth2.googleapis.com/token', {
grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
assertion: token,
});
const accesstoken = response.data;
console.log(accesstoken);
} catch (error) {
console.log(error.data);
}
};

I was missing this part in signing the token: 
*sub: GOOGLE_MMC_MANAGER_EMAIL,*

*GOOGLE_MMC_MANAGER_EMAIL *is the email that you created the MMC account 
with. 


On Wednesday, January 6, 2021 at 5:36:01 AM UTC+10 Eylon Raymond Harari 
wrote:

> Hi Ernie, 
> sorry for the late response. 
>
> I have created all the process from scratch and tested, retested, and 
> still getting the same error. 
>
> The *Reply privately to author* option is disabled and I can only send a 
> public response - Is there an address for me to send the details or can you 
> enable this option for me?
>
> Thanks
> On Tuesday, December 22, 2020 at 5:47:44 PM UTC+10 adsapiforumadvisor 
> wrote:
>
>> Hi Eylon,
>>
>> Thanks for posting your concern.
>>
>> Could you confirm if you tried following the instruction discussed on 
>> this document 
>> <https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-service>?
>>  
>> If not, please do so and if the error persists, you can provide the 
>> following details via *Reply privately to author* option: 
>>
>>- customer ID 
>>- complete request and response logs with request ID 
>>
>>
>> If you haven't enabled the logging of the API transactions yet for Python 
>> client library, you can follow this guide 
>> <https://developers.google.com/google-ads/api/docs/client-libs/python/logging>
>> .
>>
>> Regards,
>> [image: Google Logo] 
>> Ernie John Blanca Tacata 
>> Google Ads API Team 
>>   
>>
>> ref:_00D1U1174p._5004Q29TUMy: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 
"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/e7cad65b-56eb-47e5-9451-9d9df2a036b4n%40googlegroups.com.


Re: Using Service account [HTTP error 401]: “Request had invalid authentication credentials. Expected OAuth 2 access token…”

2021-01-05 Thread Eylon Raymond Harari
Hi Ernie, 
sorry for the late response. 

I have created all the process from scratch and tested, retested, and still 
getting the same error. 

The *Reply privately to author* option is disabled and I can only send a 
public response - Is there an address for me to send the details or can you 
enable this option for me?

Thanks
On Tuesday, December 22, 2020 at 5:47:44 PM UTC+10 adsapiforumadvisor wrote:

> Hi Eylon,
>
> Thanks for posting your concern.
>
> Could you confirm if you tried following the instruction discussed on this 
> document 
> ?
>  
> If not, please do so and if the error persists, you can provide the 
> following details via *Reply privately to author* option: 
>
>- customer ID 
>- complete request and response logs with request ID 
>
>
> If you haven't enabled the logging of the API transactions yet for Python 
> client library, you can follow this guide 
> 
> .
>
> Regards,
> [image: Google Logo] 
> Ernie John Blanca Tacata 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q29TUMy: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 
"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/3a560f64-f049-4ec7-b947-1e4e88d5d55en%40googlegroups.com.


Using Service account [HTTP error 401]: “Request had invalid authentication credentials. Expected OAuth 2 access token…”

2020-12-19 Thread Eylon Raymond Harari
Im building an app with google ads api using a *service account* auth flow 
(server to server). The problem - the auth part is not working...


*Sample of the request:*

const request = require('request');
 
 request({
   'method': 'GET', 'url': 
'https://googleads.googleapis.com/v6/customers/',
   'headers': {
 'Authorization': 'Bearer ', 
 'developer-token': '', '
 Content-Type': 'application/json' }
 }) ...

*or using curl -> *

curl --location --request GET 
'https://googleads.googleapis.com/v6/customers/' \ --header 
'Authorization: Bearer ' \ --header 'developer-token: ' \ 
--header 'Content-Type: application/json'


*[ERROR] Response from google ads api:*

{ 
   "code": 401, 
   "message": "Request had invalid authentication credentials. Expected 
OAuth 2 access token, login cookie or other valid authentication 
credential. See

 https://developers.google.com/identity/sign-in/web/devconsole-project.;, 
   "status": "UNAUTHENTICATED"
 }

I can't seem to find out why I'm getting this authentication error.

What I have tried:

   1. Following this guide step by step -> 
   https://developers.google.com/google-ads/api/docs/oauth/service-accounts
   2. Using the python library -> 
   https://github.com/googleads/googleads-python-lib
   3. Using the google ads API with REST (no library)
   4. On localhost server
   5. On the production server (the www.g-suite.com domain linked to the 
   account)

Whatever method or environment I try, it results in the same error.



*Sample of how I create the access token (nodejs) -> this part works 
fine:*const 
{ google } = require('googleapis'); 



const getAccessToken = async () => {

const SCOPES = ['https://www.googleapis.com/auth/adwords'];

const authClient = new google.auth.GoogleAuth({

keyFile: './pathtokeyfile.json',

scopes: SCOPES,

});

const token = await authClient.getAccessToken();

return token;

};

*Steps I have implemented:*

   - Created a google ads manager account
   - Generated a valid developer token for that account
   - Created project in Google cloud platform
   - Opened a service account inside the project
   - Created a private key for the service account
   - Granting impersonation abilities in the G Suite domain for this scope: 
*https://www.googleapis.com/auth/adwords 
   *
   - Enabled domain-wide delegation on the service account
   - Generated the *access token* with the key JSON file.

*I am surely missing something, but am not sure what it is..*


Will be super grateful if someone can share a solution!! thanks champs 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/650353ba-27c6-4aca-a136-314c95ce60b7n%40googlegroups.com.


Re: Google Ads API - Service account [HTTP error 401]: “Request had invalid authentication credentials. Expected OAuth 2 access token…”

2020-12-19 Thread Eylon Raymond Harari
This is how I am creating the access token in nodejs (this part is working 
fine)

const { google } = require('googleapis'); 
 ...
 const getAccessToken = async () => {
const SCOPES = ['https://www.googleapis.com/auth/adwords']; 
const authClient = new google.auth.GoogleAuth({ keyFile: 
'./pathtokeyfile.json', scopes: SCOPES, }); 
const token = await authClient.getAccessToken();
return token; 
};

On Sunday, December 20, 2020 at 6:55:58 AM UTC+10 Eylon Raymond Harari 
wrote:

> Im building an app with google ads api using a *service account* auth 
> flow (server to server). The problem - the auth part is not working...
>
> *Sample of the request:*
> ```
> request({ 'method': 'GET', 'url': '
> https://googleads.googleapis.com/v6/customers/', 'headers': { 
> 'Authorization': 'Bearer ', 'developer-token': '', 
> 'Content-Type': 'application/json' } }) 
> ```
>
> or
> curl --location --request GET '
> https://googleads.googleapis.com/v6/customers/' \ --header 
> 'Authorization: Bearer ' \ --header 'developer-token: ' \ 
> --header 'Content-Type: application/json' [ERROR] Response from google ads 
> api:{ "code": 401, "message": "Request had invalid authentication 
> credentials. Expected OAuth 2 access token, login cookie or other valid 
> authentication credential. See 
> https://developers.google.com/identity/sign-in/web/devconsole-project.;, 
> "status": "UNAUTHENTICATED" }
>
>
> *[ERROR] Response from google ads api:*{ "code": 401, "message": "Request 
> had invalid authentication credentials. Expected OAuth 2 access token, 
> login cookie or other valid authentication credential. See 
> https://developers.google.com/identity/sign-in/web/devconsole-project.;, 
> "status": "UNAUTHENTICATED" }
>
> I cant seem to find out why Im getting this authentication error.
>
> What I have tried:
>
>1. Following this guide step by step -> 
>https://developers.google.com/google-ads/api/docs/oauth/service-accounts
>2. Using the python library -> 
>https://github.com/googleads/googleads-python-lib
>3. Using the google ads API with REST (no library)
>
> Whatever method / library I try, it results in the same error.
>
> Created a google ads manager account
>
>- Generated a valid developer token for that account
>- Created project in Google cloud platform
>- Opened a service account inside the project
>- Created a private key for the service account
>- Enabled domain-wide delegation for the service account
>- Granting impersonation abilities in the G Suite domain for this 
>scope: *https://www.googleapis.com/auth/adwords 
><https://www.googleapis.com/auth/adwords>*
>- Using a g-suite domain
>- Generated the *access token* with the key json file.
>- Made the request to *google ads api* from localhost and also from 
>the web-app (which matches the g-suite domain). Both of them give me the 
>same 401 error.
>
> *I am surely missing something, but am not sure what it is..*
> Will be super grateful if someone can share a solution!! thanks champs 
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/cfea1051-db18-4018-b53b-da80878a8840n%40googlegroups.com.


Google Ads API - Service account [HTTP error 401]: “Request had invalid authentication credentials. Expected OAuth 2 access token…”

2020-12-19 Thread Eylon Raymond Harari


Im building an app with google ads api using a *service account* auth flow 
(server to server). The problem - the auth part is not working...

*Sample of the request:*
```
request({ 'method': 'GET', 'url': 
'https://googleads.googleapis.com/v6/customers/', 'headers': { 
'Authorization': 'Bearer ', 'developer-token': '', 
'Content-Type': 'application/json' } }) 
```

or
curl --location --request GET 
'https://googleads.googleapis.com/v6/customers/' \ --header 
'Authorization: Bearer ' \ --header 'developer-token: ' \ 
--header 'Content-Type: application/json' [ERROR] Response from google ads 
api:{ "code": 401, "message": "Request had invalid authentication 
credentials. Expected OAuth 2 access token, login cookie or other valid 
authentication credential. See 
https://developers.google.com/identity/sign-in/web/devconsole-project.;, 
"status": "UNAUTHENTICATED" }


*[ERROR] Response from google ads api:*{ "code": 401, "message": "Request 
had invalid authentication credentials. Expected OAuth 2 access token, 
login cookie or other valid authentication credential. See 
https://developers.google.com/identity/sign-in/web/devconsole-project.;, 
"status": "UNAUTHENTICATED" }

I cant seem to find out why Im getting this authentication error.

What I have tried:

   1. Following this guide step by step -> 
   https://developers.google.com/google-ads/api/docs/oauth/service-accounts
   2. Using the python library -> 
   https://github.com/googleads/googleads-python-lib
   3. Using the google ads API with REST (no library)

Whatever method / library I try, it results in the same error.

Created a google ads manager account

   - Generated a valid developer token for that account
   - Created project in Google cloud platform
   - Opened a service account inside the project
   - Created a private key for the service account
   - Enabled domain-wide delegation for the service account
   - Granting impersonation abilities in the G Suite domain for this scope: 
*https://www.googleapis.com/auth/adwords 
   *
   - Using a g-suite domain
   - Generated the *access token* with the key json file.
   - Made the request to *google ads api* from localhost and also from the 
   web-app (which matches the g-suite domain). Both of them give me the same 
   401 error.

*I am surely missing something, but am not sure what it is..*
Will be super grateful if someone can share a solution!! thanks champs 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/4baa8b9a-be9c-4a99-b3fd-df6244d63d05n%40googlegroups.com.