【问题标题】:Getting 403:Forbidden posting to my timeline获取 403:禁止发布到我的时间线
【发布时间】:2014-02-07 00:45:57
【问题描述】:

我已在开发者控制台中为我的项目启用镜像 API。我授权了镜像 API 并在 OAuth 操场上生成了一个访问令牌。在操场上建立一个请求或手动发送它我总是得到 403 错误。有人可以帮忙吗?

wget --header="Authorization: Bearer access-token" --header="Content-Type: application/json" --post-data="{ \"text\": \"Hello world\" } " https://www.googleapis.com/mirror/v1/timeline --2014-02-07 00:35:00-- https://www.googleapis.com/mirror/v1/timeline 正在解析 www.googleapis.com (www.googleapis.com)... 74.125.129.95, 2607:f8b0:400e:c04::5f 正在连接到 www.googleapis.com (www.googleapis.com)|74.125.129.95|:443... 已连接。 已发送 HTTP 请求,等待响应... 403 Forbidden 2014-02-07 00:35:00 错误 403:禁止。

【问题讨论】:

    标签: android google-mirror-api


    【解决方案1】:

    1) 在 Playground 中构建请求

    Glass Playground 网站的底部有一个名为显示游乐场使用信息的红色按钮。

    如果您点击该按钮,您将看到授予 Playground 访问时间线的权限信息。

    要让 Playground 访问时间线:

    1. 创建Google APIs project client ID
    2. https://mirror-api-playground.appspot.com添加到列表中 客户端 ID 的授权 JavaScript 来源
    3. 将您的客户端 ID 复制到 Playground 并开始与 你的时间线。

    2) 以编程方式构建请求

    如果您在以编程方式发送TimelineItems 时遇到403: Forbidden 错误,那可能是因为您没有使用正确的clientIdclientSecret 值。

    编辑:Glass Playground站点(红色按钮下)复制了三个项目。

    【讨论】:

      猜你喜欢
      • 2021-04-29
      • 2015-02-18
      • 2019-02-26
      • 2021-04-29
      • 1970-01-01
      • 2023-01-14
      • 2012-06-18
      • 2012-10-13
      • 1970-01-01
      相关资源
      最近更新 更多