Daniel, You definitely want to be caching your Auth Tokens. Using Java, you can stick them in a static map with a key of clientId. The documentation says they're good for ~2 weeks, but I only cache them for 5 days as I've run into problems before with longer expirations. As far as testing whether the token is still valid, using the 5 day cache expiration I haven't run into any problems with expired tokens.
Pete On Aug 11, 7:46 am, Daniel <[email protected]> wrote: > Hi Kevin, > > >Could you provide a little more detail about the exact error you are > >receiving? > > sure, but i don't know what more i can say ... > > I work with the Java Client Library. Every night, i want to download a > Keyword Performance Report for several Accounts. > While doing this, i sometimes get the error mentioned above. > > Here you can see my code for generating the AdwordsUser Obect: > mAdwordsUser = new AdWordsUser(pAccount.getUserName(), > pAccount.getUserPass(), pAccount.getClientId(), "Application Token", > "Developer Token)"; > > This works fine over the last years (with small changes from version > to version) > > > Have you tried caching them and see if reusing them prevents this type of > > problem from occurring? > > Not yet. What is the best way to do that and how can i check, if my > AuthToken is still valid or needs to be renewed? > > Thanks for the help! > > Regards, > Daniel > > On Aug 10, 4:19 pm, Kevin Winter <[email protected]> wrote: > > > > > > > > > Hi Daniel, > > Could you provide a little more detail about the exact error you are > > receiving? > > > It sounds like the script requests a new Client Login token each time it > > runs. These authtokens are valid for 2 weeks. Have you tried caching them > > and see if reusing them prevents this type of problem from occurring? > > > - Kevin Winter > > AdWords API Team -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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
