我正在尝试使用 API Explorer 和 Chrome Advanced Rest Client 根据给定示例观看事件资源。 https://developers.google.com/google-apps/calendar/v3/push#watch_request_examples
请求
POST https://www.googleapis.com/calendar/v3/calendars/XXX%40gmail.com/events/watch?key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.AHES6ZSNBYiHYPu6Y1_5P08hdb-EX5pdF4Ygj5ou_RKp_jOCS5beiDDH
X-JavaScript-User-Agent: Google APIs Explorer
{
"id": "01234567-89ab-cdef-0123456789ab",
"type": "web_hook",
"address": "https://www.example.com/WebHook/Index",
"token": "token=123546"
}
回复
401 Unauthorized
cache-control: private, max-age=0
content-encoding: gzip
content-length: 188
content-type: application/json; charset=UTF-8
date: Thu, 17 Oct 2013 12:49:00 GMT
expires: Thu, 17 Oct 2013 12:49:00 GMT
server: GSE
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.example.com/WebHook/Index"
}
],
"code": 401,
"message": "Unauthorized WebHook callback channel: https://www.example.com/WebHook/Index"
}
}
- 我已经将我的域 www.example.com 列入白名单
我已经获得了接收推送通知所必需的 ssl 证书
我用谷歌搜索了这个问题,但找不到太多帮助。
- 在 google group of calender api 上发布了相同的问题,但还没有回复。https://groups.google.com/forum/#!topic/google-calendar-api/ZHKwm2xWuNE
任何人都可以指导,请求有什么问题?