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

Google ApiGoogle Api-Client

Google Api Problem Overview


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?

Google Api Solutions


Solution 1 - Google Api

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.

Solution 2 - Google Api

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.

Solution 3 - Google Api

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.

Solution 4 - Google Api

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.

Solution 5 - Google Api

I faced a similar issue, the problem is in the settings we do in google developer project.

Refer to create-play-service-credentials for settings. Use the same primary account with which you created your in-app products.

Make sure you remove the previous one.

Link to a Google Developer Project Your Play Developer account needs to be linked to a Google Developer Project.

1a. Open the Settings > Developer account menus and select API access

API-access

1b. Select Link to connect your Play account to a Google Developer Project

choose-project-link

1c. Agree to the terms and conditions

agree-terms-conditions

2. Create Service Account Next we need to create a service account. This is done from the Google API Console.

2a. Select Create Service Account

create-service-account

2b. Create Service account key credentials

service-account

2c. Enter details for service account

enter-service-account-details

2d. Download your JSON credential: json-credentials

3. Grant Access

3a. In Play Console, select Grant Access on the newly created service account

grant-access

3b. Grant the following permissions:

apply-permissions

After granting access, Google takes 24-48 hours to propagate all access rights for all API's, till that time you'll continue to get the same error.

Solution 6 - Google Api

Wait up to 24h OR create/edit any In-App product to force permission update,it takes 1-2 minutes to update and no need to wait 24h.

Solution 7 - Google Api

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

Solution 8 - Google Api

For someone who is facing this exact issue then the simple answer is to check the permissions to the service account which is linked in the Google Developer Console.

1.Open the Settings > Developer account menus and select API access 2.Choose the service account and check the permissions- REMEMBER FINANCE PERMISSION IS MUST FOR THIS ACTION

enter image description here

And after giving the permission update your subscription/package and make a new purchase then try again.

Happy Coding!

Solution 9 - Google Api

For my scenario:

If you are using service account to verify purchase via Google Play Developer API. Ensure you also click the View app information and download bulk reports (read only) permission besides the Financial data permissions.

enter image description here

After edited the permissions, update the in-app products and subscription (eg. change the descriptions).

Then wait for around 30 mins, the permission error gone. 

Solution 10 - Google Api

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.

Solution 11 - Google Api

It will automatically be fixed after 24 hrs, don't waster your time and energy with hacks, just wait and watch.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNguyen HoangView Question on Stackoverflow
Solution 1 - Google ApiWojciech KulikView Answer on Stackoverflow
Solution 2 - Google ApibikramView Answer on Stackoverflow
Solution 3 - Google ApiihsanberahimView Answer on Stackoverflow
Solution 4 - Google ApigridsquareView Answer on Stackoverflow
Solution 5 - Google ApiAnkit JindalView Answer on Stackoverflow
Solution 6 - Google ApiEnakhiView Answer on Stackoverflow
Solution 7 - Google ApipanserView Answer on Stackoverflow
Solution 8 - Google ApiShivam YadavView Answer on Stackoverflow
Solution 9 - Google ApiJT501View Answer on Stackoverflow
Solution 10 - Google ApileeCoderView Answer on Stackoverflow
Solution 11 - Google ApiShoaib AhmedView Answer on Stackoverflow