未经授权的 WebHook 回调通道 Google 推送通知

Unauthorized WebHook callback channel Google push notifications

我正在尝试监控 Google 驱动器中的文件。 通过获取传递渠道的通知。 我什么都试过了,试了数百次,但每次他都告诉我: `

我正在使用 Postman。

Post https://www.googleapis.com/drive/v2/changes/watch
Body:

  {"id": "01234567-89ab-cdef-012345***789ab",
  "kind":"drive#startPageToken",
  "type": "webhook",
  "address": "https://nwafith.com/api/notifications"
   }

回应

{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "push.webhookUrlUnauthorized",
                "message": "Unauthorized WebHook callback channel: https://www.nwafith.com/api/notifications"
            }
        ],
        "code": 401,
        "message": "Unauthorized WebHook callback channel: https://www.nwafith.com/api/notifications"
    }
}

在域验证中 我补充了:

www.nwafith.com

nwafith.com

一切正常,但我不知道问题出在哪里。 希望得到帮助

Unauthorized WebHook callback channel:

表示您没有在 Google 开发者控制台中正确授权您的域。

解决方案:

  1. 前往Google Developers Console
  2. Select 你的项目
  3. 下'APIS & AUTH'select'Push'
  4. 点击'Add domains'
  5. 输入需要的域名(只需要域名:https://www.nwafith.com
  6. 单击 'Add domains' 按钮

之后它应该可以工作了。