Sourav
Sourav

Reputation: 39

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

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 a service account (I'm an owner of the project). After that i create a json file key to authenticate. Tried to using google-api-client in PHP, Google Developer API Playground to send request to In-App-Purchase details of my apps but got error: "The current user has insufficient permissions to perform the requested operation." Details as below:

Request:

GET Request https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}?access_token={access_token}

Response

Array
(
    [error] => Array
        (
            [code] => 401
            [message] => The current user has insufficient permissions to perform the requested operation.
            [errors] => Array
                (
                    [0] => Array
                        (
                            [message] => The current user has insufficient permissions to perform the requested operation.
                            [domain] => androidpublisher
                            [reason] => permissionDenied
                        )

                )

        )

)

Upvotes: 2

Views: 1885

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117244

The Method: purchases.products.get operates on private user data. Due to that fact you used Oauth2 to authorize a user and get an access token.

this method requires that the user to consent to the following scope

enter image description here

The error message The current user has insufficient permissions to perform the requested operation.

Means one of two things.

  • you authorized the user but not with the above scope, if you changed the scope remember the user must consent to this scope so you need to be sure that it popped up the consent screen for the user again.
  • The user who you have authorized themselves does not have access to this information in which case you need to authorize a user with access.

Upvotes: 0

Related Questions