Hi,

I'm downloading customer data using a customer OAuth token.

I'm seeing the following error:

Google::Ads::GoogleAds::Errors::GoogleAdsError(Google::Ads::GoogleAds::Errors::GoogleAdsError):
 
User doesn't have permission to access customer. Note: If you're accessing 
a client customer, the manager's customer id must be set in the 
'login-customer-id' header. See 
https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid

My token structure looks like this (Ruby))

client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|
  config.client_id = ENV.fetch('GOOGLE_CONSUMER_KEY')
  config.client_secret = ENV.fetch('GOOGLE_CONSUMER_SECRET')
  config.developer_token = ENV.fetch('GOOGLE_DEVELOPER_TOKEN')
  config.refresh_token = token['refresh_token'] # customers oauth refresh 
token
  config.logger = Logger.new(STDOUT)
  config.login_customer_id = token['manager_id'] # managers (mcc) ID
end

customer_id = token['uid'] # customers oauth uid

ga_service = client.service.google_ads

responses = ga_service.search_stream(
  :customer_id => customer_id,
  :query => <<~QUERY
 
As far as I can tell, the manager_id has the customer_id as a child. The 
oauth token is valid, and the login_customer_id header is being supplied.

What have I missed to make this run correctly?

Thanks,

 -- Rob

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/c68c76ae-20b4-414b-aa50-e926afe26a45n%40googlegroups.com.

Reply via email to