vic*_*cki 8 android google-api google-api-client google-oauth
我在调用 Google Play Developer API 时遇到问题。
我已按照https://developers.google.com/android-publisher/authorization 上列出的所有步骤进行操作。这包括
然后,为了调用 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 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"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
我已阅读并实施了其他帖子中推荐的更改,例如
我也尝试通过https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions/get#authorization-scopes调用 API, 但仍然没有运气(得到一个错误)。
如果有人有任何建议,将不胜感激。谢谢。
我遇到了类似的问题,问题出在我们在 google 开发者项目中所做的设置中。
有关设置,请参阅create-play-service-credentials。使用与您创建应用内商品相同的主帐户。
确保删除前一个。
链接到 Google 开发者项目 您的 Play 开发者帐户需要链接到 Google 开发者项目。
1a. 打开设置 > 开发者帐户菜单并选择 API 访问
1b. 选择链接将您的 Play 帐户连接到 Google 开发者项目
1c。同意条款与条件
2. 创建服务帐户 接下来我们需要创建一个服务帐户。这是从 Google API 控制台完成的。
2a. 选择创建服务帐户
2b. 创建服务帐号密钥凭据
2c。输入服务帐户的详细信息
3. 授予访问权限
3a. 在 Play 管理中心,在新创建的服务帐户上选择授予访问权限
3b. 授予以下权限:
3c.点击底部的邀请用户并发送邀请
您将被重定向到用户和权限,您应该在其中看到新创建的服务帐户处于活动状态。
| 归档时间: |
|
| 查看次数: |
2581 次 |
| 最近记录: |