Hi,

1. Yes, I think i've been doing everything correctly to generate refresh 
token

2. Yes, I've been using java client library for making api requests. To 
make it easier i'll share some code about how i generate refresh token

*Client Side Javascript Code(For authorizing on behalf of the user)*

gapi.auth2.getAuthInstance().grantOfflineAccess().then(function(resp) {
      //pass resp.code to my servlet
}

*Server Side Java*

GoogleAuthorizationCodeFlow authorizationFlow = new 
GoogleAuthorizationCodeFlow.Builder(
        new NetHttpTransport(),
        new JacksonFactory(),
        CLIENT_ID,
        CLIENT_SECRET,
        Arrays.asList(SCOPE))
        .setAccessType("offline").build();

                //Request token with offline access code
GoogleAuthorizationCodeTokenRequest tokenRequest = 
authorizationFlow.newTokenRequest(offlineAccessCode);
    tokenRequest.setRedirectUri(CALLBACK_URL);
    GoogleTokenResponse tokenResponse = tokenRequest.execute();

    *String refreshToken = tokenResponse.getRefreshToken();*

3. Here are java logs that are generated when the report downloading error 
occurs

HTTP Response Code: 400, Trigger: Missing client information, Type: 
ReportDownloadError.INVALID_PARAMETER
at 
com.google.api.ads.adwords.lib.utils.v201809.DetailedReportDownloadResponseException$Builder.build(DetailedReportDownloadResponseException.java:35)
at 
com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelperImpl.handleResponse(AdHocReportDownloadHelperImpl.java:117)
at 
com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelperImpl.downloadReport(AdHocReportDownloadHelperImpl.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at 
com.google.api.ads.common.lib.utils.AdsUtilityInvocationHandler.handleInvocation(AdsUtilityInvocationHandler.java:46)
at 
com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:84)
at com.sun.proxy.$Proxy50.downloadReport(Unknown Source)
at 
com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelper.downloadReport(AdHocReportDownloadHelper.java:46)
at 
com.google.api.ads.adwords.lib.utils.v201809.ReportDownloader.downloadReport(ReportDownloader.java:65)
at google.retargeting.util.GoogleAds.getReport(GoogleAds.java:122)
at 
google.retargeting.servlet.GoogleApiServlet.doGet(GoogleApiServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

 Thank you

On Thursday, July 18, 2019 at 9:37:29 AM UTC+3, adsapiforumadvisor wrote:
>
> Hi Doğan,
>
> My apologies for the back and forth and thank you for detailing your 
> process. However, I have a few other questions to ask so I can better 
> identify the cause of the issue :
>
> 1. Could you confirm if you have completely followed the steps mentioned 
> in our OAuth2 credentials 
> <https://developers.google.com/adwords/api/docs/guides/authentication> 
> guide, specifically when generating the refreshToken?
>
> 2. Could you confirm if you are using any of the AdWords API's client 
> libraries <https://developers.google.com/adwords/api/docs/clientlibraries> 
> when sending your request? I asked this because if you are generating the 
> request manually, some information may not have been passed correctly in 
> your request header.
>
> 3. Could you provide the complete logs that were generated when the error 
> occurred?
>
> You may send your reply again *privately*. As for my private responses, 
> it should be sent directly to your personal email or the one you specified 
> in the thread/forum.
>
> Thanks and regards,
> Peter
> Google Ads API Team
>
> ref:_00D1U1174p._5001U8LUsA:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/5bc09ea6-67d9-44f7-9f66-408276c95cea%40googlegroups.com.

Reply via email to