更新时间:2023-02-14 12:29:32
RTFM!
我不在优秀的uri上。正确的插入必须位于 https://www.googleapis.com/calendar/v3/calendars
I was not on the good uri. The correct insertion must be on https://www.googleapis.com/calendar/v3/calendars
而不是 https://www.googleapis.com/calendar/v3/users/me/calendarList 。
代码是:
Calendar newCal = new Calendar();
newCal.setSummary(calTitle);
newCal.setTimeZone("Europe/Paris");
Calendar createdCalendar = null;
try {
createdCalendar = service.calendars().insert(newCal).execute();
} catch (Exception e){
e.printStackTrace();
}