0
我实施了一个实用程序,使用Google Calendar API和服务器端身份验证流程执行后台操作,无需用户界面。 现在我想从私人日历中读取事件,而不使用带有离线访问的授权流程或将日历公开。Google Calendar API服务器端访问
我使用这个代码进行验证:
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(SchedulerCalendar.HTTP_TRANSPORT)
.setJsonFactory(SchedulerCalendar.JSON_FACTORY)
.setServiceAccountId(SchedulerCalendar.SERVICE_ACCOUNT_EMAIL)
.setServiceAccountScopes(SchedulerCalendar.SCOPES)
.setServiceAccountPrivateKeyFromP12File(new File("key.p12")).build();
而对于读取日历活动如下:
List eventslist = calendar.events().list(calendarid);
的响应是404日历未找到。
有什么建议吗?
你是如何创建你的'Calendar'实例的?你可以添加显示该部分的代码吗? – cmbaxter