Additional information to my last post.

I got NullPointerExceptions like this:



java.lang.NullPointerException 

 at com.google.api.client.repackaged.com.google.common.base.Preconditions.
checkNotNull(Preconditions.java:191) 

 at com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java
:127) 

 at com.google.api.client.json.jackson2.JacksonFactory.createJsonParser(
JacksonFactory.java:92) 

 at com.google.api.client.json.JsonObjectParser.parseAndClose(
JsonObjectParser.java:85) 

 at com.google.api.client.json.JsonObjectParser.parseAndClose(
JsonObjectParser.java:81) 

 at com.google.api.client.auth.oauth2.TokenResponseException.from(
TokenResponseException.java:88) 

 at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(
TokenRequest.java:287) 

 at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java
:307) 

 at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.
executeRefreshToken(GoogleCredential.java:384) 

 at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.
java:489) 

 at de.jlo.talendcomp.google.adwords.AdWordsReports.initializeAdWordsSession
(AdWordsReports.java:209) 

 at AdWordsTest.main(AdWordsTest.java:34)


My last post suggest a way to avoid this problem and provide a minimum of 
information.

On Tuesday, March 3, 2015 at 10:46:57 PM UTC+1, Josh Radcliff (AdWords API 
Team) wrote:
>
> Hi Jan,
>
> That scope has been deprecated, but tokens obtained for it in the past 
> should continue to work. See our Authentication guide 
> <https://developers.google.com/adwords/api/docs/guides/authentication#scope> 
> for 
> details and for the new, recommended scope.
>
> Were your requests working previously and now fail, or are you trying to 
> submit requests for the first time? If they worked in the past, has 
> anything changed recently such as the version of the API or client library 
> that you are using?
>
> Thanks,
> Josh, AdWords API Team
>
> On Tuesday, March 3, 2015 at 2:33:18 PM UTC-5, Jan Lolling wrote:
>>
>> I have the same issue with the Java API.
>> I use the version 1.37.0 of the ads-lib and 1.19.0 for the http-client.
>>
>> At the moment I use the scope "https://adwords.google.com/api/adwords";. 
>> Is there any additional scope I have to add?
>>
>> Best regards
>> Jan Lolling
>>
>> On Wednesday, 5 November 2014 21:36:19 UTC+1, Josh Radcliff (AdWords API 
>> Team) wrote:
>>>
>>> Hi,
>>>
>>> Just to make sure I'm understanding your setup, are you using the same 
>>> version of the *client library* for both your v201406 and your v201409 
>>> tests? In other words, does v18.5 work for v201406 but not v201409, or does 
>>> v18.5 not work for either API version?
>>>
>>> Thanks,
>>> Josh, AdWords API Team
>>>
>>> On Tuesday, November 4, 2014 4:59:29 PM UTC-5, apiapi wrote:
>>>>
>>>>
>>>> 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/09cc983c-a207-4729-aab4-61553ec77a69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to