Re: Unauthorized CREATE operation in invoking a service's mutate method

2021-04-20 Thread Kenny Kandola
Thank you Xiaming and Ernie. Much better than the Facebook Ads API team :)

On Tuesday, April 20, 2021 at 3:34:31 PM UTC-4 adsapiforumadvisor wrote:

> Hi Kenny,
>
> Thank you for reaching out. The CampaignBudgetService 
> 
>  
> is a service that is used on a campaign. However, a campaign does not 
> directly exist in a manager account. You were seeing this error as you were 
> making the call to the manager account 6947334835 instead of a client 
> customer account. Please create a client account under this manager account 
> and then use this service for the client account instead.
>
> Thanks and regards,
> Xiaoming, Google Ads API Team
>  
> [image: Google Logo] 
> Xiaoming 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2FZuB8: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/12ea7250-cae8-459d-b6e7-29c8ff17ea1dn%40googlegroups.com.


Re: Unauthorized CREATE operation in invoking a service's mutate method

2021-04-20 Thread Kenny Kandola
Thanks for getting back to me.

It won't allow me to respond privately for some reason (screenshot attached 
for proof).

Here is the full request/response I get when the log level is set to 'INFO'.

I don't see any request ID specified, let me know how I can get that for 
you or anything else you need.

W, [2021-04-20T13:19:46.382087 #1]  WARN -- : CID: 6947334835, Host: 
googleads.googleapis.com:443, Method: 
/google.ads.googleads.v6.services.CampaignBudgetService/MutateCampaignBudgets, 
IsFault: yes

I, [2021-04-20T13:19:46.382357 #1]  INFO -- : Outgoing request: Headers: 
{"developer-token":"REDACTED","login-customer-id":"6947334835","x-goog-api-client":"gl-ruby/2.6.5
 
gax/0.3.4 gapic/10.0.0 
grpc/1.36.0","x-goog-request-params":"customer_id=6947334835"} Payload: 
{"customerId":"6947334835","operations":[{"create":{"name":"Budget","amountMicros":"1000","deliveryMethod":"STANDARD"}}]}

I, [2021-04-20T13:19:46.382492 #1]  INFO -- : Incoming response (errors): 

  
Google::Ads::GoogleAds::Errors::GoogleAdsError(Google::Ads::GoogleAds::Errors::GoogleAdsError):
 
Unauthorized CREATE operation in invoking a service's mutate method.

  called from: 
/usr/src/trip_tippa/app/services/find_new_advisors_service.rb:39:in 
`add_campaigns'

Google::Ads::GoogleAds::Errors::GoogleAdsError: 
Google::Ads::GoogleAds::Errors::GoogleAdsError

from 
/usr/local/bundle/gems/google-ads-googleads-10.0.0/lib/google/ads/google_ads/interceptors/error_interceptor.rb:67:in
 
`rescue in request_response'


[image: Screen Shot 2021-04-20 at 9.30.37 AM.png]
On Tuesday, April 20, 2021 at 2:08:56 AM UTC-4 adsapiforumadvisor wrote:

> Hi  Kenny,
>
> Thank you for posting your concern.
>
> To investigate the issue, could you provide the customer ID where you are 
> creating the budget and the complete request 
> 
>  
> and response 
> 
>  
> logs with request ID 
> 
>  
> generated on your end? You can provide the requested details via *Reply 
> privately to author* option.
>
> Regards,
> [image: Google Logo] 
> Ernie John Blanca Tacata 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2FZuB8: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/7f441eb4-d556-47ec-b58d-e19ca5f7b2d9n%40googlegroups.com.


Unauthorized CREATE operation in invoking a service's mutate method

2021-04-19 Thread Kenny Kandola
I've seen several posts online regarding this error but no clear answer.

When trying to create a new campaign, I get the below error.

Google::Ads::GoogleAds::Errors::GoogleAdsError(Google::Ads::GoogleAds::Errors::GoogleAdsError):
 
Unauthorized CREATE operation in invoking a service's mutate method.

The line points to this line of code:

return_budget = client.service.campaign_budget.mutate_campaign_budgets(
customer_id: customer_id,
operations: [operation],
)

I have all the proper permissions from my understanding. I have a basic 
access developer token, and I created a project and added Oauth 
credentials, and generated a refresh token with access to manage Ads. This 
is how I'm initializing Google Ads in the application and creating a 
campaign_budget. The code is a template I've modified from the github page 
for this Ruby gem . I've 
redacted the actual values.

//

client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|

config.login_customer_id = '6947334XXX'
config.developer_token = 'XXX'
config.client_id = 'XXX'
config.client_secret = 'XXX'
config.refresh_token = 'XXX'
config.log_level = 'DEBUG'
config.log_target = STDOUT
config.treat_deprecation_warnings_as_errors = false
config.warn_on_all_deprecations = false
end

campaign_budget = client.resource.campaign_budget do |cb|
cb.name = "#{@place.full_name} Budget"
cb.delivery_method = :STANDARD
cb.amount_micros = 1000
end

operation = 
client.operation.create_resource.campaign_budget(campaign_budget)

# Add budget.
return_budget = client.service.campaign_budget.mutate_campaign_budgets(
customer_id: customer_id,
operations: [operation],
)

//

Here is the full response when I try to create a campaign:

W, [2021-04-19T23:34:01.400542 #1]  WARN -- : CID: 6947334835, Host: 
googleads.googleapis.com:443, Method: 
/google.ads.googleads.v6.services.CampaignBudgetService/MutateCampaignBudgets, 
IsFault: yes

I, [2021-04-19T23:34:01.400813 #1]  INFO -- : Outgoing request: Headers: 
{"developer-token":"REDACTED","login-customer-id":"XXX","x-goog-api-client":"gl-ruby/2.6.5
 
gax/0.3.4 gapic/10.0.0 
grpc/1.36.0","x-goog-request-params":"customer_id=XXX"} Payload: 
{"customerId":"XXX","operations":[{"create":{"name":"Las Vegas, NV, United 
States Budget","amountMicros":"1000","deliveryMethod":"STANDARD"}}]}

I, [2021-04-19T23:34:01.400971 #1]  INFO -- : Incoming response (errors): 

  
Google::Ads::GoogleAds::Errors::GoogleAdsError(Google::Ads::GoogleAds::Errors::GoogleAdsError):
 
Unauthorized CREATE operation in invoking a service's mutate method.

 called from: 
/usr/src/trip_tippa/app/services/find_new_advisors_service.rb:39:in 
`add_campaigns'

Google::Ads::GoogleAds::Errors::GoogleAdsError: 
Google::Ads::GoogleAds::Errors::GoogleAdsError

from 
/usr/local/bundle/gems/google-ads-googleads-10.0.0/lib/google/ads/google_ads/interceptors/error_interceptor.rb:67:in
 
`rescue in request_response'

Thanks for looking into this. Let me know if you need anything else.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/9ff56649-6653-4a66-b725-d73d1e97bc7en%40googlegroups.com.