Admin SDK 不起作用的 G Suite 通道停止功能

G Suite channel stop function with the Admin SDK not working

这是场景和设置

  1. 我正在使用 G Suite Admin SDK to watch changes in the users data (Python API)

  2. 通知正在发送到 Google 云函数

  3. 设置工作正常。

  4. 问题是当我尝试使用它说的 SDK 停止观看资源时 <HttpError 404 when requesting https://www.googleapis.com/admin/directory/v1/admin/directory_v1/channels/stop? returned "Not Found">

我确定我使用的是正确的 idresourceId。有谁知道为什么会失败?

我发现了问题。

API 声明端点 URL 是 https://www.googleapis.com/admin/directory_v1/channels/stop 但调用中的 URL 是 https://www.googleapis.com/admin/directory/v1/admin/directory_v1/channels/stop

问题出在 SDK 本身,stop API 是文档中唯一带有 _v1 而不是 /v1 的。我相信这就是 API 出现问题的原因。只需发出常规 HTTP Post 通知即可