Google API NodeJS:calendar.events.watch获取错误push.webhookUrlNotHttps或pushWebhookBadDomain

我已经按照https://developers.google.com/google-apps/calendar/v3/push (我认为)中所需的所有设置,我正在尝试注册我的callbackURL来观看事件,并使用以下代码:

calendar.events.watch({ auth:jwtClient, resource: { id: "yourChannelId", type: 'web_hook', address: "https://api.mysite.com/notifications" }, calendarId: "mycalendarId" }, function(error, response) { if (error) { console.log(error); return; } console.log(response); }); 

我得到错误message: 'No valid domain for WebHook callback: https://https://api.mysite.com', reason: 'pushWebhookBadDomain' 。 如果我尝试将地址设置为“api.mysite.com/notifications”(因为https看起来是重复的),那么我会收到错误message: 'WebHook callback must be HTTPS: api.mysite.com/notifications', reason: 'push.webhookUrlNotHttps'

任何人都可以帮我吗? 谢谢

我得到它的工作。 我希望它可以帮助别人。 方法如下:

在Developers Console上 ,该url必须没有https,但包含该方法。

在网站pipe理员工具中 ,该url必须与https一起使用,而不仅仅是cannonical域。

我的问题是,在Developers Console上,我添加了所有的可能性 (总共4个域),但服务只使用第一个,这是错误的。

在通话中,这是正确的,与https和方法:

 resource: { id: "yourChannelId", type: 'web_hook', address: "https://api.mysite.com/notifications" }