Hello,
I finally managed to make a successful api call with this npm package;
publisher.inappproducts.list({ ... returns the expected result and everything is great.
But when I go for:
publisher.purchases.subscriptions.get({
packageName: packageName,
subscriptionId: subscriptionId,
token: token
}) ...
It always returns the same error:
The current user has insufficient permissions to perform the requested operation.
Assuming that:
- The current user is a service account with the highest possible permissions granted in both the developer console and the google play console. (including "view financial data")
- The project in the google developer console is linked to the app in the google play console.
- The
packageName, subscriptionId and token parameters sent are valid.
What could possibly be missing?
Is a refresh_token needed with service accounts?
Could there be discrepancy between the permissions shown in the UI and the actual permissions granted to the service account?
Does the service account need to "accept" the invitation to be a "owner"?
Is there a way to list the service account's permissions through the API?
Here is the code I use for authentication:
const {google} = require('googleapis');
async function main () {
// This method looks for the GCLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS
// environment variables.
const auth = await google.auth.getClient({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/androidpublisher']
});
// obtain the current project Id
const project = await google.auth.getProjectId();
const publisher = google.androidpublisher({
auth: auth,
version: 'v3',
project: project
});
...
Environment details
- OS: OSX 10.14 (Mojave)
- Node.js version: 8.11.4
- npm version: 5.6.0
googleapis version: 34.0.0
Thanks for making it down here.
Hello,
I finally managed to make a successful api call with this npm package;
publisher.inappproducts.list({ ...returns the expected result and everything is great.But when I go for:
It always returns the same error:
The current user has insufficient permissions to perform the requested operation.
Assuming that:
packageName,subscriptionIdandtokenparameters sent are valid.What could possibly be missing?
Is a refresh_token needed with service accounts?
Could there be discrepancy between the permissions shown in the UI and the actual permissions granted to the service account?
Does the service account need to "accept" the invitation to be a "owner"?
Is there a way to list the service account's permissions through the API?
Here is the code I use for authentication:
Environment details
googleapisversion: 34.0.0Thanks for making it down here.