【发布时间】:2013-10-19 06:16:53
【问题描述】:
我正在尝试使用 API 资源管理器和 Chrome 高级 Rest 客户端根据给定示例观看事件资源。 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 ofcalender api 上发布了同样的问题,但还没有回复。 https://groups.google.com/forum/#!topic/google-calendar-api/ZHKwm2xWuNE
任何人都可以指导,请求有什么问题?
【问题讨论】:
标签: push-notification google-calendar-api