NOT_ADS_USER Error when accessing Google Ads API from service account

94 views
Skip to first unread message

Adam Ghoumrassi

unread,
Oct 5, 2020, 7:24:18 AM10/5/20
to AdWords API and Google Ads API Forum
Hello,

I am trying to access data on Ads campaigns from my Google Ads Manager account. 

So far I have:

- Linked my Ad Manager account with the AdWords account I need access to
- Gained approval for the application and access to the developer token
- Set up a service account 
- Created a google-ads.yaml file containing my private key, delegate account and developer token

However, when I attempt to access the data from the Python SDK I still get the following error:

google.ads.google_ads.errors.GoogleAdsException: (<_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAUTHENTICATED
details = "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project."
debug_error_string = "{"created":"@1601896655.920000000","description":"Error received from peer ipv4:xx.xx.xx.xx:xxx","file":"src/core/lib/surface/call.cc","file_line":1062,"grpc_message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","grpc_status":16}"
>, <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAUTHENTICATED
details = "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project."
debug_error_string = "{"created":"@1601896655.920000000","description":"Error received from peer ipv4: xx.xx.xx.xx:xxx","file":"src/core/lib/surface/call.cc","file_line":1062,"grpc_message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","grpc_status":16}"
>, errors {
  error_code {
    authentication_error: NOT_ADS_USER
  }
  message: "User in the cookie is not a valid Ads user."
}
, 'xxxxxxxxxxxxxxxx')


Any idea what's going on?

Google Ads API Forum Advisor Prod

unread,
Oct 5, 2020, 3:28:59 PM10/5/20
to fl...@onefourzero-group.com, adwor...@googlegroups.com

Hi Adam,

Thank you for reaching out. The NOT_ADS_USER error usually occurs when the login used to generate the access token is not associated with any Google Ads account. To make the process easier I would suggest you to use OAuth Installed Application Flow or OAuth Web Application Flow instead of service accounts. OAuth2 installed application and web flows require user interaction only once, when access to the account is granted.

Thanks and regards,
Xiaoming, Google Ads API Team


Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q25ZAPA:ref
Reply all
Reply to author
Forward
0 new messages