Service accounts

56 views
Skip to first unread message

micro...@gmail.com

unread,
May 2, 2019, 12:38:26 PM5/2/19
to AdWords API and Google Ads API Forum
I'm trying to use the ol Adwords PHP API library with a service account. Each time I do this it gives me the error NOT_ADS_USER https://developers.google.com/adwords/api/docs/common-errors#AuthenticationError.NOT_ADS_USER

I have the jsonKeyFilePath, scopes, developerToken, clientCustomerID  and the impersonatedEmail. Is there other information that I should need? 

Also I noticed the new Ads api does not support Service account so it's necessary to use raw api calls. Does that mean this feature will no longer work with the old API?

googleadsapi...@google.com

unread,
May 2, 2019, 5:06:10 PM5/2/19
to micro...@gmail.com, AdWords API and Google Ads API Forum
Hello, 

We strongly recommend using installed app or web flows instead of service accounts unless you need domain-specific features (for example, impersonation). OAuth2 installed application and web flows require user interaction only once, when access to the account is granted. Is there any specific reason you're using service accounts to make the API calls? 

The NOT_ADS_USER is seen when the service account is not linked correctly to the Google Ads account via OAuth2 assertion flow. Please refer to this guide on how to create the service account and link to the Google Ads account. 

Thanks,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

micro...@gmail.com

unread,
May 3, 2019, 9:27:06 AM5/3/19
to AdWords API and Google Ads API Forum
Hey Bharani, 

Thank you for your response. We want to use a service account to separate billing and usage between groups.

Thanks, 
Andrew 

googleadsapi...@google.com

unread,
May 3, 2019, 2:25:07 PM5/3/19
to micro...@gmail.com, AdWords API and Google Ads API Forum
Hello Andrew, 

You can achieve the same functionality using the Web application or the Installed application flow. Using a service account is rare, and most people use a refresh token since people can easily run long-running jobs with just a refresh token. If you're able to just get things done with the refresh token and not the service account, I strongly recommend just doing it that way because it is a lot easier to debug unless you definitely require a specific service account feature. Please check this guide for more information.


Thanks,
Bharani, Google Ads API Team
Reply all
Reply to author
Forward
0 new messages