且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Google日历API v3中插入新的calendarEntry会返回404

更新时间: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();
    }