Hi I am not sure this is common sense of calendar API developer but I has 
been struggling with following code which create "Unknown authorization 
header Error 401" or "Oauth invalid Error 401"
 UserService userService = UserServiceFactory.getUserService();
String user_email = userService.getCurrentUser().getEmail();
 GoogleOAuthParameters oauthParameters2 = new GoogleOAuthParameters();
oauthParameters2.setOAuthConsumerKey( CONSUMER_KEY);
oauthParameters2.setOAuthConsumerSecret(CONSUMER_SECRET); 
 URL feedUrl = new URL("http://www.google.com/calendar/feeds/"; + user_email 
+ "/private/full?xoauth_requestor_id" + user_email);
CalendarQuery calendarQuery = new CalendarQuery(feedUrl);
calendarQuery.setMinimumStartTime(App.CreateDateTime(-30, 0));
calendarQuery.setMaximumStartTime(App.CreateDateTime(+60, 0));
calendarQuery.addCustomParameter(new CustomParameter("orderby", 
"starttime"));


I could fix this problem by adding new 
Query.CustomParameter("xoauth_requestor_id", user_email))

UserService userService = UserServiceFactory.getUserService();
String user_email = userService.getCurrentUser().getEmail();
 GoogleOAuthParameters oauthParameters2 = new GoogleOAuthParameters();
oauthParameters2.setOAuthConsumerKey( CONSUMER_KEY);
oauthParameters2.setOAuthConsumerSecret( CONSUMER_SECRET); 
 URL feedUrl = new URL("http://www.google.com/calendar/feeds/"; + user_email 
+ "/private/full?xoauth_requestor_id" + user_email);
CalendarQuery calendarQuery = new CalendarQuery(feedUrl);
calendarQuery.setMinimumStartTime(App.CreateDateTime(-30, 0));
calendarQuery.setMaximumStartTime(App.CreateDateTime(+60, 0));
calendarQuery.addCustomParameter(new CustomParameter("orderby", 
"starttime"));
*calendarQuery.addCustomParameter(new 
Query.CustomParameter("xoauth_requestor_id", user_email));*

-- 
You received this message because you are subscribed to the Google
Groups "Google Calendar Data API" 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://code.google.com/apis/calendar/community/forum.html

Reply via email to