Nav*_*oti 2 google-calendar-api push-notification
该问题的任何解决方案。这似乎不起作用
{
"error": {
"errors": [
{
"domain": "global",
"reason": "push.webhookUrlUnauthorized",
"message": "Unauthorized WebHook callback channel: https://xxxxx"
}
],
"code": 401,
"message": "Unauthorized WebHook callback channel: https://xxxxx"
}
}
Run Code Online (Sandbox Code Playgroud)
无论如何要解决这个问题
推送通知要求您已验证域所有权,因此无法在 API Explorer 中创建,因为它不提供将请求与您已验证所有权的项目相关联的方法。如果您使用项目凭据,这可以在 OAuth Playground 中完成,详情如下:
配置API项目:
配置 OAuth Playground:
授权 API 请求:
单击“输入请求正文”,然后输入您的请求,例如:
{
"id": "c887ce64-adc8-4007-952c-a172c376b30d",
"type": "web_hook",
"address": "https://example.com/watch"
}
完成后点击“关闭”。
https://www.googleapis.com/calendar/v3/calendars/user@example.com/events/watch点击“发送请求”。
您应该会收到类似于以下内容的回复:
{
"resourceId": "DmuNd7MI-w7qwW1FxDNf_pdqk7Y",
"kind": "api#channel",
"expiration": "1507327087000",
"id": "c887ce64-adc8-4007-952c-a172c376b30d",
"resourceUri": "https://www.googleapis.com/calendar/v3/calendars/user@example.com/events?maxResults=250&alt=json"
}
注意:其他 API 的推送通知,例如Directory API,可能有额外的参数。有关详细信息,请查看相关的参考文档。
| 归档时间: |
|
| 查看次数: |
3770 次 |
| 最近记录: |