Google Play Developer API - "The current user has insufficient permissions to perform the requested operation."
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?
Solution 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.
Solution 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.
- Go to https://console.cloud.google.com
- Create a project (or select existing project)
- Create a service account with role Pub/Sub Admin
- Go to https://console.cloud.google.com/apis/library and search for "Google Play Android Developer API"
- Enable that API
- Go to https://play.google.com/apps/publish
- Go to Settings > Developer account > API Access
- Link the project that you created in step 2
- The service account will appear that you created in step 3
- Grant access to it with Finance permission to the app in play console
- Very important: Wait for at least 24 hours for changes to take effect.
Solution 3:
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:
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:
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
1b. Select Link to connect your Play account to a Google Developer Project
1c. Agree to the terms and 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
2b. Create Service account key credentials
2c. Enter details for service account
2d. Download your JSON credential:
3. Grant Access
3a. In Play Console, select Grant Access on the newly created service account
3b. Grant the following 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.