首页 > 解决方案 > 需要帮助将 Google Cloud Function URL 注册为已验证域以接收推送通知

问题描述

我正在尝试调用谷歌日历的推送通知 API。我写了一个谷歌云函数,它只返回一个包含请求正文和标头的响应。我想使用这个谷歌云功能 url 作为推送通知的接收 url。谷歌文档提到了验证和注册域的步骤,作为其中的一部分,它要求我上传二进制文件。不确定如何针对此云功能域上传二进制文件。我的域看起来像https://asia-northeast1-project-name.cloudfunctions.net

这是我注册推送通知的请求:请求:

发布https://www.googleapis.com/calendar/v3/calendars/primary/events/watch?key= { YOUR_API_KEY } { "id": "404713b9-d880-437d-b890-83715f01af7c", "type": " web_hook", "地址": " https://asia-northeast1-huddle-quick-solutions.cloudfunctions.net/suratCalendarNotifications " }

回复:

{ "error": { "errors": [ { "domain": "global", "reason": "push.webhookUrlUnauthorized", "message": "未经授权的 WebHook 回调通道:https://asia-northeast1-project- name.cloudfunctions.net/path " } ], "code": 401, "message": "Unauthorized WebHook callback channel: https://asia-northeast1-project-name.net/path " } }

标签: google-calendar-apigoogle-cloud-functions

解决方案


推荐阅读