I am using a Service Account with the .NET library for v201402, it has run
runs fine without needing OAuth. My code explicitly adds clientCustomerId
to every call and does keyword planner API and other API calls without
issues.
I updated my code to instead reference the v201409 libraries. When the
v18.5 code runs, I get this error from the Adwords API:
Reason:AdsOAuthException.
Google.Api.Ads.Common.Lib.AdsOAuthException: Failed to get access token for
service account.
{
"error" : "access_denied",
"error_description" : "Requested client not authorized."
}
at Google.Api.Ads.Common.Lib.OAuth2ProviderForServiceAccounts.
GenerateAccessTokenForServiceAccount() in c:\goo\googleads-adwords-dotnet-
lib-master18.5\s
rc\Common\Lib\OAuth2ProviderForServiceAccounts.cs:line 145
at Google.Api.Ads.Common.Lib.OAuth2ProviderForServiceAccounts.
RefreshAccessToken() in c:\goo\googleads-adwords-dotnet-lib-master18.5\src\
Common\Lib\OAut
h2ProviderForServiceAccounts.cs:line 154
at Google.Api.Ads.Common.Lib.OAuth2ProviderBase.
RefreshAccessTokenIfExpiring() in c:\goo\googleads-adwords-dotnet-lib-
master18.5\src\Common\Lib\OAuth2Pr
oviderBase.cs:line 249
at Google.Api.Ads.Common.Lib.OAuth2ProviderBase.GetAuthHeader() in c:\goo
\googleads-adwords-dotnet-lib-master18.5\src\Common\Lib\OAuth2ProviderBase.
cs:l
ine 240
at Google.Api.Ads.AdWords.Lib.AdWordsSoapClient.InitForCall(String
methodName, Object[] parameters) in c:\goo\googleads-adwords-dotnet-lib-
master18.5\sr
c\AdWords\Lib\AdWordsSoapClient.cs:line 61
at Google.Api.Ads.Common.Lib.AdsSoapClient.MakeApiCall(String methodName,
Object[] parameters) in c:\goo\googleads-adwords-dotnet-lib-master18.5\src\
Com
mon\Lib\AdsSoapClient.cs:line 211
at Google.Api.Ads.Common.Lib.AdsSoapClient.Invoke(String methodName,
Object[] parameters) in c:\goo\googleads-adwords-dotnet-lib-master18.5\src\
Common\L
ib\AdsSoapClient.cs:line 127
at Google.Api.Ads.AdWords.v201409.TrafficEstimatorService.get(
TrafficEstimatorSelector selector) in c:\goo\googleads-adwords-dotnet-lib-
master18.5\src\A
dWords\v201409\AdWordsApi.cs:line 20557
What do I need to change to get my Service Account to be recognized/used
for v201409? I tried changing the properties of my request header to
Version = "v201409" and GroupName = "mcm" and UserAgent ="mycustomstring"
and DeveloperToken = "mydevtoken" but things are still unauthorized.
I can run v201402 code side-by-side with v201409 code, I only get refused
by v201409 code.
Please help?
Thanks.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/9d1ba2fc-5bc3-4aff-b75e-d2a233bcd030%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.