Hi Shwetha, 
   We use the Java API and this is what we are doing: 

1. Initialize the scope and the callback url 
2. Configure AuthorizationCodeFlow 

GoogleAuthorizationCodeFlow authorizationFlow = new 
GoogleAuthorizationCodeFlow.Builder(new NetHttpTransport(), new 
JacksonFactory(), clientSecrets, 
Lists.newArrayList(SCOPE)).setAccessType("offline").build();

3. Get the 'Authorization URL' 
4. Put the 'Authorization URL' in the browser and get the authorization 
code 
5. Authorize the OAuth2 token 

GoogleAuthorizationCodeTokenRequest tokenRequest = 
authorizationFlow.newTokenRequest(authorizationCode);
tokenRequest.setRedirectUri(CALLBACK_URL);
GoogleTokenResponse tokenResponse = tokenRequest.execute();


6. Create the OAuth2 credential and set the token response 


GoogleCredential credential = new GoogleCredential.Builder().setTransport(new 
NetHttpTransport()).setJsonFactory(new 
JacksonFactory()).setClientSecrets(clientSecrets).build();

credential.setFromTokenResponse(tokenResponse);


7. Get the refresh token from the GoogleCredential object 
8. Use that refresh token in the application 

Hope this is what you were looking for.. .


Thanks,

Ramz


On Wednesday, November 30, 2016 at 8:41:19 AM UTC-8, Shwetha Vastrad 
(AdWords API Team) wrote:
>
> Hi Ramz,
>
> Could you provide the steps you followed to generate your refresh token 
> and the complete error you received with the new refresh token? If you 
> happen to have any SOAP XML request and response logs, it'll be helpful as 
> well. 
>
> Thanks,
> Shwetha, AdWords API Team.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/669ae441-af8f-4aba-9ccb-76f6a547196f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • com.google.api.... Fatma Ben Hamza
    • Re: com.go... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
      • Re: co... Fatma Ben Hamza
        • Re... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
          • ... P Ramz
            • ... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
              • ... P Ramz
                • ... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
                • ... P Ramz
                • ... 'Josh Radcliff (AdWords API Team)' via AdWords API Forum

Reply via email to