I'm trying to migrate from Adwords API to Ads API, so I'm reusing the 
clientId, Client Secret and refresh token that I've used for Adwords API, 
as it was clearly mentioned in Ads Api Documentation that I can re-use them.

On Saturday, 16 March 2019 00:43:49 UTC+5:30, Krishna Kishore wrote:
>
> I was trying the example 
> https://github.com/googleads/google-ads-java/blob/master/google-ads-examples/src/main/java/com/google/ads/googleads/examples/basicoperations/GetAdGroups.java,
>  
> but was getting the below error.
>
>
> Status: Status{code=UNAUTHENTICATED, description=Request is missing 
> required authentication credential. Expected OAuth 2 access token, login 
> cookie or other valid authentication credential.
>
> I tried to get the session, using the following code
>
> Credentials credentials =
>     UserCredentials.newBuilder()
>         .setClientId("INSERT_CLIENT_ID")
>         .setClientSecret("INSERT_CLIENT_SECRET")
>         .setRefreshToken("INSERT_REFRESH_TOKEN")
>         .build();
> GoogleAdsClient googleAdsClient =
>     GoogleAdsClient.newBuilder()
>         .setCredentials(credentials)
>         .setDeveloperToken("INSERT_DEVELOPER_TOKEN_HERE")
>         .setLoginCustomerId("INSERT_LOGIN_CUSTOMER_ID_HERE") // Manager 
> accounts only.
>         .build();
>
>
> Am I missing anything?? Should I be giving the access token?? If yes where 
> I can get the access token? 
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/aff70087-3994-4b26-9634-77d035ce7ae3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Error t... Krishna Kishore
    • Re... Krishna Kishore
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to