Google Drive watch API: 如何设置通知请求headers/body

Google Drive watch API: How to set request headers/body of notification

https://developers.google.com/drive/api/v3/reference/files/watch

查看此文档后,我找不到任何选项来设置要发送到我的 webhook 端点的其他请求 headers 和 body。所以我不能为这些通知设置授权令牌之类的东西,对吗?

您有多种选择:

  1. 在URL
  2. 中添加令牌
  3. 使用 headers X-Goog-Channel-Token(参数 token)and/or X-Goog-Channel-ID(参数 id
  4. 进行验证

第一个你只需 Google 调用一个 URL 并返回令牌。第二个你使用你知道的数据来确保它是 Google 谁在发送留言。

参考资料