问题描述
我正在尝试使用API资源管理器和Chrome Advanced Rest Client根据给定的示例观看事件资源. https://developers.google.com/google-apps/calendar/v3/push#watch_request_examples
I am trying to watch events resource based on given example using API explorer and 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证书,该证书对于接收推送是必不可少的通知
- I have already whitelisted my domain www.example.com
I have already got ssl certificate which is mandatory to receive pushnotifications
我在Google上搜索了此问题,但找不到太多帮助.
I googled about this issue , but could not find much help.
任何人都可以指导,请求有什么问题吗?
can anybody guide, whats wrong with request ?
推荐答案
要实现这一目标,我缺少的一个步骤是在控制台中实际启用Calendar API.401 push.webhookUrlUnauthorized错误在这里确实没有帮助.
The one step I was missing to get this working was to actually enable the Calendar API in the console. The 401 push.webhookUrlUnauthorized error is really not helpful here.
这篇关于无法收到有关Google日历的推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!