我正在尝试在Google日历API中实现推送通知功能。我还在网站管理员工具和云控制台中将我的域https://www.skygazr.com列入白名单。
现在我正在尝试创建Watch请求的工作副本时,它正在给我一个webhookUrlUnauthorized错误。
请检查以下请求和回复。
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"
}
}
如果有人可以帮助我,我真诚地感谢你的帮助。我尝试了几种方法,但总是导致同样的问题。仅供参考我正在检查来自https://developers.google.com/oauthplayground
此致 迪内希