Hi Ernie And Moshik
Sorry to bother you both.
I am having the same issue as Moshik.
I have looked over the documentation and am still confused sorry.
If I am using the python sdk and using the load_from_dict() method.
By adding the login-customer-id and client _id to the dict credentials will
this work?
here is a sample of my script below
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
credentials = {
"developer_token": MCC DEVELOPER TOKEN,
"refresh_token": "xxxxxxx,
"client_secret": xxxxxx,
"login-customer-id" :MCC_ID,
"customer_id" : ACCOUNT_ID,
"access_token" : XXXXX'
}
client = GoogleAdsClient.load_from_dict(credentials)
The account sits under an mcc that sits under another mcc.
which combination of developer token, mcc id for the login-customer-id
should I use?
This all renders fine
but when I then go on to execute rendering the report with the below code
customer_id= ACCOUNT_ID
ga_service = client.get_service("GoogleAdsService")
query = """
SELECT
campaign.id,
campaign.name
FROM campaign
ORDER BY campaign.id"""
# Issues a search request using streaming.
response = ga_service.search_stream(customer_id=customer_id, query=query )
it always gives this error:
message: "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"
}
Apologies can u please elaborate some more.
For reference the oauth2 is working correctly and i have successfully
gotten the refresh token. The app type is desktop.
Many thanks
Bosh
On Monday, July 5, 2021 at 7:59:27 PM UTC+10 adsapi wrote:
> Hi Moshik,
>
> Thank you for raising your concern.
>
> You may refer to this document
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure>
> as
> it discussed the structure of all API calls, especially this section
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid>
>
> as it explained what you need to set in the *login-customer-id* and where
> the user account / email address used to generate the Oauth2 credential
> should have access.
>
> Regards,
> [image: Google Logo]
> Ernie John Blanca Tacata
> Google Ads API Team
>
>
> ref:_00D1U1174p._5004Q2JYa3Y: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 [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/0f684555-a7ab-444f-a00e-c507233ced1cn%40googlegroups.com.