3

Google Apps アプリケーションを使用しています。実は、パスワードを使わずに別のIDにアクセスしたいのです。OAuthを使用しましたが、うまく機能しています。しかし、特定の人のカレンダーを共有することはできません。次のコードを試しました。

GoogleOAuthParameters oauthParam=new GoogleOAuthParameters();
oauthParam.setOAuthConsumerKey("xxxx.com");
oauthParam.setOAuthConsumerSecret("xxxxxxxxxxxxxxxxxxx");
oauthParam.setScope("http://www.google.com/calendar/feeds/");
URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/owncalendars  full?xoauth_requestor_id=user@example.com");
CalendarService service=new CalendarService("calendar");
service.setOAuthCredentials(oauthParam,new OAuthHmacSha1Signer());
AclEntry entry = new AclEntry();
entry.setScope(new AclScope(AclScope.Type.USER,"any.user"));
entry.setRole(CalendarAclRole.READ);
AclEntry insertedEntry = service.insert(feedUrl, entry);

このコードでは、次のエラーが発生しました。

com.google.gdata.util.InvalidEntryException: Bad Request
Calendar entry does not contain title
    at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:558)
    at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
4

1 に答える 1

0

カレンダー エントリの代わりに ACL エントリを独自のカレンダー フィードに挿入することはお勧めできません。また、この API は非推奨になりました。参照にはhttp://code.google.com/apis/calendar/v3/getting_started.htmlを使用してください。

于 2011-12-15T12:29:12.163 に答える