向Google Calendar API发出请求的问题

时间:2018-05-25 16:41:42

标签: javascript google-calendar-api

我遇到了一个我不明白的问题。该脚本正在运行,突然它说该请求未定义。

这是脚本:

    function insertEvents(){

     var event = {
      "summary": userEmail ,
      "location": '4 rue mogador Trouville sur mere',
      "description": 'Test de lgtrouville.com',
      "end": [
       {"dateTime": "2018-05-28T10:00:00+02:00"},
       {"timeZone": "Europe/Paris"} 
      ],
      "start": [
       {"dateTime": "2018-05-25T10:00:00+02:00"},
       {"timeZone": "Europe/Paris"} 
      ],
      "attendees": [
       {"email": "lpage@example.com"},
       {"email": "sbrin@example.com"}
      ],
      "reminders": {
       "useDefault": false,
       "overrides": [
        {"method": "email", "minutes": 24 * 60},
        {"method": "popup", "minutes": 10}
       ]
      }
     };

    var request = gapi.client.calendar.events.insert({
    'calendarId': userEmail ,
    'resource': event
    });

    request.execute(function(event) {
    appendPre('Event created: ' + event.htmlLink);
    });       
 }

输出结果表明event.htmlLinkundefined。我可能在var event

的语法中出错

0 个答案:

没有答案