Google Calendar API Push notifications issue

旧街凉风 提交于 2019-12-25 04:55:10

问题


I am trying to implement push notifications feature in Google calendar api. I have also whitelisted my domain https://www.skygazr.com in webmaster tools and cloud console.

Now while am trying to create a working copy of Watch request it is giving me a webhookUrlUnauthorized error.

Please check the below request and response.

OST /calendar/v3/calendars/info%40bacnn.com/events/watch HTTP/1.1
Host: www.googleapis.com
Content-length: 111
Content-type: application/json
Authorization: Bearer ya29.1.AADtN_UTGxLw6gmqJTJIPX1VhOyuUckZw-yNjIPznP5Wefl0sxwnertq7ZEYP647CDOvQQ
{
  "address": "https://www.skygazr.com/notifications",
  "id": "push-notif-bacnn-0123456789ab",
  "type": "web_hook"
}
HTTP/1.1 401 Unauthorized
Content-length: 302
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Expires: Wed, 11 Dec 2013 10:25:14 GMT
Server: GSE
Cache-control: private, max-age=0
Date: Wed, 11 Dec 2013 10:25:14 GMT
X-frame-options: SAMEORIGIN
Content-type: application/json; charset=UTF-8
Www-authenticate: Bearer realm="https://www.google.com/accounts/AuthSubRequest", error=invalid_token
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "push.webhookUrlUnauthorized",
    "message": "Unauthorized WebHook callback channel: https://www.skygazr.com/notifications"
   }
  ],
  "code": 401,
  "message": "Unauthorized WebHook callback channel: https://www.skygazr.com/notifications"
 }
}

I sincerely appreciate your help if someone can help me out here. I tried several methods and always its resulting the same issue. FYI I am checking request and response from https://developers.google.com/oauthplayground

Regards, Dinesh

来源:https://stackoverflow.com/questions/20517294/google-calendar-api-push-notifications-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!