仅在查询GET订阅时在Google Developer API中获得401响应

时间:2018-09-21 21:52:21

标签: google-api google-oauth2 android-billing

我正在使用Google Play Android开发人员API。我从带有服务帐户的服务器访问它。我有私钥并获得了访问令牌。

我使用范围https://www.googleapis.com/auth/androidpublisher。当我问subscription info时,出现401错误:

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

但是当我使用具有相同令牌和相同范围的其他查询时,我得到了成功的答复。例如,我可以成功获得voided purchases listinfo about inapp product

200 OK
{
     "packageName": "com.myapp.exapmle",
     "sku": "subscr_month",
     "status": "active",
     "purchaseType": "subscription",
     "defaultPrice": {
      "priceMicros": "149000000",
      "currency": "RUB"
}

可能是什么原因造成的?我将此服务帐户添加到开发人员控制台并提供了所有权限(管理员访问权限)。

0 个答案:

没有答案