Google Play Developer API - “The current user has insufficient permissions to perform the requested operation.”

故事扮演 提交于 2020-11-26 10:25:47

问题


I have a Google dev console process with Google Play Developer API is enabled and the project is linked to Google Play project. In Google Dev console project, created OAuth Client ID (web application) (I'm an owner of the project). Using "client_id" and "client_secret" to authenticate. Tried to using google-api-client in Python, Google Developer API Playground to send request to list reviews of our apps but got error: "The current user has insufficient permissions to perform the requested operation." Details as below: Request:

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

Response:

"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"
      }
    ]
  }
}

Did I miss anything?


回答1:


There is a very important thing about receipt validation using Google Play Android Developer API.

If you added your in-app product BEFORE granting permission or linking to your service account, you need to open "In-app products" and perform some update. You can for example edit description of your product and save. You should instantly get permission.

👏 Google




回答2:


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

Ensure you have done everything correctly as below.

  1. Go to https://console.cloud.google.com
  2. Create a project (or select existing project)
  3. Create a service account with role Pub/Sub Admin
  4. Go to https://console.cloud.google.com/apis/library and search for "Google Play Android Developer API"
  5. Enable that API
  6. Go to https://play.google.com/apps/publish
  7. Go to Settings > Developer account > API Access
  8. Link the project that you created in step 2
  9. The service account will appear that you created in step 3
  10. Grant access to it with Finance permission to the app in play console
  11. Very important: Wait for at least 24 hours for changes to take effect.



回答3:


After adding a new user in the Google Play Console, Google needs up to 24 hours to propagate all access rights for all apis.

I ran into the same issue, when I've tried to using the oauth2 flow to access the Inapp purchases status api. It's not official documented, but this github comment helped me to figure this out.




回答4:


If you followed all what @Bikram listed and you still facing the same error. Do this, create 'Managed product' temporary and then delete them. This way, sure you don't have to wait 24 hours.

It works for me.




回答5:


I used service key and created it in Google APIs Credentials Cloud Platform, and I had the same issue until I added my created service key to Google Developer Console with all access.

I understood that you already created credentials in Google Developer Console, but maybe my experience will help someone else




回答6:


For me the reason i had this issue because I did not check the permission to Release to production, exclude devices and use app signing by Google Play in Google Playstore console for the service account I created to manage app creation and management.

So check Users and Permission in the Google Play store console and check if the appropriate permission is checked.



来源:https://stackoverflow.com/questions/43536904/google-play-developer-api-the-current-user-has-insufficient-permissions-to-pe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!