hi

  I am trying to retrieve the number of events from the calendar using
query. When i used 2-legged OAuth its returning the Token invalid
error. the is the code that i tried

   CalendarService client = new CalendarService("yourCompany-
YourAppName-v1");
          client.setOAuthCredentials(oauthParameters, signer);
                    System.out.println("authentication no error");

                    URL feedUrl = new URL("https://www.google.com/
calendar/feeds/[email protected]/private/full?
[email protected]");
                    System.out.println("url no error");

          CalendarQuery myQuery = new CalendarQuery(feedUrl);
 
myQuery.setMinimumStartTime(DateTime.parseDateTime("2010-09-19T00:00:00"));
 
myQuery.setMaximumStartTime(DateTime.parseDateTime("2010-09-19T23:59:59"));

          System.out.println("myquery no error");

          Feed resultFeed = client.query(myQuery,Feed.class);

i got the following error
Exception in thread "main"
com.google.gdata.util.AuthenticationException: Token invalid - Invalid
AuthSub token.
<HTML>
<HEAD>
<TITLE>Token invalid - Invalid AuthSub token.</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Token invalid - Invalid AuthSub token.</H1>
<H2>Error 401</H2>
</BODY>
</HTML>

        at
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:
596)
        at
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:
563)
        at
com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:
550)
        at
com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:
530)
        at
com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:
535)
        at com.google.gdata.client.Service.getFeed(Service.java:1135)
        at com.google.gdata.client.Service.getFeed(Service.java:1077)
        at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
662)
        at com.google.gdata.client.Service.query(Service.java:1237)
        at com.google.gdata.client.Service.query(Service.java:1178)
        at SMS.call(SMS.java:62)
        at SMS.main(SMS.java:94)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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/google-appengine?hl=en.

Reply via email to