【问题标题】:Stop watching google push notifications停止观看谷歌推送通知
【发布时间】:2015-09-28 10:36:05
【问题描述】:

我正在使用 Google Reports API 来监视资源的变化,例如用户的 Google 日历活动事件。为此,按照以下步骤创建了一个频道(或观察点):https://developers.google.com/admin-sdk/reports/v1/reference/activities/watch

现在,我想在频道到期之前停止观看资源。我发送了一个 POST 请求以及标头中的访问令牌,正文包含通道 ID 和资源 ID (https://developers.google.com/admin-sdk/reports/v1/reference/channels/stop)。但是我不断收到 404 Not Found。我在这里做错了吗?

使用相同访问令牌的所有其他请求都可以正常工作。

我的请求/响应如下所示:

POST /admin/reports/v1/channels/stop HTTP/1.1
Host: www.googleapis.com
Content-length: 97
Content-type: application/json
Authorization: Bearer ya29.rAExOpnO_gatfyJvKWEVt8OsQ-LyaCyN3UUFjYzm0-3ExEBZ9an7WWfdDLqJspChQaiiIQ
{
  "id": "5cfc250b-2faf-4f86-91b3-398326c6b4fb",
  "resourceId": "A_HZ7mQy0Zpd6-TkQjr3aQlWd94"
}


HTTP/1.1 404 Not Found
Content-length: 9
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Vary: Origin,X-Origin
Server: GSE
Pragma: no-cache
Cache-control: no-cache, no-store, max-age=0, must-revalidate
Date: Fri, 10 Jul 2015 17:10:40 GMT
X-frame-options: SAMEORIGIN
Content-type: text/html; charset=UTF-8
Not Found

【问题讨论】:

  • 您是否在 OAuth Playground (developers.google.com/oauthplayground) 上看到相同的 404 错误?您能否编辑并包含您的请求/响应(必要时进行清理)?
  • 是的,同样的 404 错误。我还注意到 OAuth Playground 上停止操作的请求 URI 与开发人员文档中列出的不同。两个我都试过了……
  • 如果您在 OAuth Playground 上看到同样的问题,这听起来可能是一个错误。如果您是 Google Apps 管理员,您可以向 Google 记录一个案例,让他们检查/确认这一点。您也可以在这里提出问题:code.google.com/a/google.com/p/apps-api-issues/issues/list

标签: google-admin-sdk


【解决方案1】:

原来文档中指定的请求 URL 是错误的。 正确的是 https://www.googleapis.com/admin/reports_v1/channels/stop

此处报告的问题:https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3914

【讨论】:

    猜你喜欢
    • 2018-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-27
    • 1970-01-01
    • 2016-04-09
    • 2017-08-25
    相关资源
    最近更新 更多