Google Play Developer API - “当前用户没有足够的权限执行请求的操作。”

问题描述 投票:4回答:3

我有一个Google开发者控制台流程,启用了Google Play Developer API,该项目已链接到Google Play项目。在Google Dev控制台项目中,创建了OAuth客户端ID(Web应用程序)(我是项目的所有者)。使用“client_id”和“client_secret”进行身份验证。试图在Python中使用google-api-client,Google Developer API Playground发送请求列出我们应用的评论,但收到错误:“当前用户没有足够的权限来执行请求的操作。”详情如下:要求:

GET /androidpublisher/v2/applications/<package_name>/reviews

响应:

"error": {
    "code": 401, 
    "message": "The current user has insufficient permissions to perform the requested operation.", 
    "errors": [
      {
        "domain": "androidpublisher", 
        "message": "The current user has insufficient permissions to perform the requested operation.", 
        "reason": "permissionDenied"
      }
    ]
  }
}

我错过了什么吗?

google-api google-api-client
3个回答
4
投票

I looked everywhere on the internet and found somewhere that you might need to wait for at least 24 hours.

确保您已正确完成所有操作,如下所示。

  1. https://console.cloud.google.com
  2. 创建项目(或选择现有项目)
  3. 使用角色Pub / Sub Admin创建服务帐户
  4. 转到https://console.cloud.google.com/apis/library并搜索“Google Play Android Developer API”
  5. 启用该API
  6. https://play.google.com/apps/publish
  7. 转到设置>开发人员帐户> API访问
  8. 链接您在步骤2中创建的项目
  9. 将显示您在步骤3中创建的服务帐户
  10. 在Play控制台中为应用程序的“财务”权限授予对它的访问权限
  11. 非常重要:等待至少24小时才能使更改生效。

3
投票

在Google Play控制台中添加新用户后,Google最多需要24小时才能传播所有api的所有访问权限。

当我试图使用oauth2 flow访问Inapp purchases status api时,我遇到了同样的问题。这不是官方记录,但这个github comment帮助我解决了这个问题。


1
投票

我使用了服务密钥并在Google API凭据云平台中创建了它,在我将创建的服务密钥添加到Google Developer Console并具有所有访问权限之前,我遇到了同样的问题。

我知道您已经在Google Developer Console中创建了凭据,但也许我的经验会帮助其他人

© www.soinside.com 2019 - 2024. All rights reserved.