当前位置: 首页 > 知识库问答 >
问题:

获取谷歌日历假日节点

祁正浩
2023-03-14

只用我的日历ID工作得很好.

 function listEvents(auth) {
       var calendar = google.calendar('v3');
       calendar.events.list({
       auth: auth,
       calendarId: 'en.thai#holiday@group.v3.calendar.google.com',
       timeMin: (new Date()).toISOString(),
       maxResults: 10,
       singleEvents: true,
       orderBy: 'startTime'
       }, function(err, response) {
          if (err) {
             console.log('The API returned an error: ' + err);
             return;
       }
       var events = response.items;
       if (events.length == 0) {
          console.log('No upcoming events found.');
       } else {
         console.log('Upcoming 10 events:');
         for (var i = 0; i < events.length; i++) {
            var event = events[i];
            var start = event.start.dateTime || event.start.date;
            console.log('%s - %s', start, event.summary);
          }
        }
      });
     }

en.thai#holiday@group.v3.calendar.google.com |en.th#holiday@group.v3.calendar.google.com |en.uk#holiday@group.v.calendar.google.com 请帮忙谢谢你

calenderId:“me”或“primary………..output:”所有事件列表“

日历Id:en.th#holiday@group.v3.calendar.google.com.......输出:API返回错误:错误:未找到

共有1个答案

邵阳德
2023-03-14

试用日历 Id: en.th#holiday@group.v.calendar.google.com

你可以通过https://developers . Google . com/Google-apps/calendar/v3/reference/events/list进行测试

如果你尝试这个api,你可以找到你自己国家的calendarId

https://developers.google.com/google-apps/calendar/v3/reference/calendarList/list

 类似资料:
  • 使用节点https://github.com/google/google-api-nodejs-client库,我试图访问公共假期。我有身份验证工作,并可以访问API。当我测试事件时。使用API资源管理器列出endpoint,我怀疑日历有效。 日历 Id :“en.sa#holiday@group.v.calendar.google.com” 存在于我的个人日历中,但不存在于应用日历中。 当我尝试

  • 我正在使用谷歌日历API V3。 我正在尝试列出所选国家的所有假日https://www.googleapis.com/calendar/v3/calendars/en.uk#holiday@group.v.calendar.google.com/events?key=mykey 但首先我需要用所有支持的国家/地区ID创建一个select。我在这里找到了国家ID列表:https://gist.gi

  • 在使用GoogleCalendarAPI(与python一起使用)时,我已经能够获得我想要的变量,因此我可以将事件导出到文本文件中。然而,一个变量(位置)触发了一个错误,我不知道为什么。 这直接来自google的开始代码,我还添加了我想要的变量: 它会打印一个即将到来的约会列表,包括地点,但它会停止并向我抛出这个错误 这是凭据/json的问题吗?我使用的是谷歌日历api的旧版本吗?我怎么检查?我的

  • 谷歌日历API…/auth/Calendar查看、编辑、共享和永久删除您可以使用谷歌日历访问的所有日历 谷歌日历API…/auth/Calendar。acls查看并更改您拥有的Google日历的共享权限 谷歌日历API…/auth/Calendar。事件查看和编辑所有日历上的事件 CalendarQuickstart或CalendarReader很好,它们从日历中读取,但:当我尝试写入日历时,我得

  • 如果我是对的,timemax='2012-10-25t23:59:59z'-给我的事件可能是从?to this datetime timemin='2012-10-25t23:59:59z'-为我提供了结束此datetime的事件

  • 我想知道我是否需要Google java客户端库才能从GAE访问我的Google日历。默认情况下,它们是Google App Engine SDK的一部分吗? 此外,我找不到一个很好的示例或教程来展示如何从Google Cloud Platform应用程序创建、读取、更新和删除Google日历事件。 非常感谢,如果您可以提供相同的代码示例或链接到适当的工作教程。