I have followed all the setups required in https://developers.google.com/google-apps/calendar/v3/push (I think) and I'm trying to register my callback URL to watch events, with this code:
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);
});
And I get the error message: 'No valid domain for WebHook callback: https://https://api.mysite.com', reason: 'pushWebhookBadDomain'
. If I try to put the address as just "api.mysite.com/notifications" (as it seems that the https is getting duplicated), then I get the error message: 'WebHook callback must be HTTPS: api.mysite.com/notifications', reason: 'push.webhookUrlNotHttps'
Can anyone help me please? Thank you
I got it to work. I hope it can help someone. Here is the way:
on Developers Console, the URL must be without the https but with the method included.
on Webmaster Tools, the URL must be with the https but just the cannonical domain.
My problem was that on Developers Console I added all possibilities (4 domains in total), but the service just uses the first one, which was wrong.
In the call, It was right, with https and method:
resource: {
id: "yourChannelId",
type: 'web_hook',
address: "https://api.mysite.com/notifications"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With