小编dan*_*ior的帖子

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

我已按照https://developers.google.com/google-apps/calendar/v3/push(我认为)中的所有设置进行操作,并且我正在尝试注册我的回调网址以观看事件,并使用以下代码:

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);

});
Run Code Online (Sandbox Code Playgroud)

我得到了错误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'

有人可以帮我吗?谢谢

google-calendar-api node.js google-api-nodejs-client

5
推荐指数
1
解决办法
400
查看次数