Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7 #8

Open
PrisonMike-115 opened this issue Sep 8, 2024 · 0 comments
Open

#7 #8

PrisonMike-115 opened this issue Sep 8, 2024 · 0 comments

Comments

@PrisonMike-115
Copy link
Collaborator

This may be the wrong place to post this, but I'm having difficulty reaching anyone familiar with google apis on either android-developers or google-apis-explorer-users forums.

I'm having a problem deciphering the root cause of a cryptic "invalid value" response for the androidpublisher.inapppurchases.get api. OAuth is working fine, and I'm able to get the access_token as well as refresh_token.

I'm guessing something in the parameters are malformed or missing but cannot decipher where. The dev console project seems to be connected correctly because for an unauthorized user, querying on my packageName throws a permission denied error.

I also suspected the productId may be malformed, and I tried all sorts of combinations such as subs:{packageName}:pro_monthly_15, {packageName}:pro_monthly_15, etc. with all the same invalid response.

Can anyone help me shed some light on this?

oauth2Client.credentials = {
            access_token: '{removed}',
            refresh_token: '{removed}'
        };

        googleapis
            .discover('androidpublisher', 'v1.1')
            .execute(function(err, client) {

                console.log(['discovered', err, client.androidpublisher.apiMeta]);

            var params = {
                packageName: '{removed}',
                productId:   'pro_monthly_15',
                token:       'glhannifclifbhdgbpalegib.AO-J1OyeEpe0JagpGtG588_Jor3mtqjp_CRB-xGdq55kqMMWqGyGd2YlesHdazWPnOC4CoB0EVP-o_j1LT7taDJE8vUxg7UcjzeMPZ4WHi79aTYdv3FalrvqKAFTvWZqJqwjecdGaTpa'
            };
            client
                .androidpublisher.inapppurchases.get(params)
                .withAuthClient(oauth2Client)
                .execute(function (err, response) {
                    console.log([err, response]);

                    res.json({
                        response: response,
                        error: err
                    });
            });
        });

Cryptic response:

{
  "response": null,
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "invalid",
        "message": "Invalid Value"
      }
    ],
    "code": 400,
    "message": "Invalid Value"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant