小编vic*_*cki的帖子

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

我在调用 Google Play Developer API 时遇到问题。

我已按照https://developers.google.com/android-publisher/authorization 上列出的所有步骤进行操作。这包括

  1. 创建项目并启用Google Play Android Developer API(使用我的 Google Play Console 帐户)
  2. 通过 Settings > Developer Account > API Access 链接项目
  3. 通过 Google Play 管理中心向应用授予对具有财务权限的服务帐户的访问权限。
  4. 创建OAuth 2.0 Client IdClient SecretRedirect URI凭证。
  5. 通过发送 POST 请求生成刷新令牌访问令牌

然后,为了调用 purchase.subscriptions.get API,我使用了以下 CURL 命令:

https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions/get

curl -X GET "https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}" -H "Authorization: Bearer {access_token}" -H "Accept: application/json" --compressed
Run Code Online (Sandbox Code Playgroud)

但是,我收到以下错误:

"error": {
    "code": 401, 
    "message": "The …
Run Code Online (Sandbox Code Playgroud)

android google-api google-api-client google-oauth

8
推荐指数
1
解决办法
2581
查看次数