Skip to content

Google Play Android Developer API return 401 #548

@wonderfly

Description

@wonderfly

From Jonhy.co...@gmail.com on June 20, 2012 00:58:05

Version of google-api-java-client (e.g. 1.5.0-beta)? Google Play Android Developer API v1-rev2-1.7.1-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? Java 6 Describe the problem. Server return 401 Unauthorized: This developer account does not own the application. How would you expect it to be fixed? HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
JsonFactory JSON_FACTORY = new JacksonFactory();

                     GoogleCredential credential = new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT)
                .setJsonFactory(JSON_FACTORY)
                .setServiceAccountId(GOOGLE_CLIENT_MAIL)
                .setServiceAccountScopes(" https://www.googleapis.com/auth/androidpublisher" )
                .setServiceAccountPrivateKeyFromP12File(new File(GOOGLE_KEY_FILE_PATH))
                .build();

        Androidpublisher publisher = new Androidpublisher.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).
                setApplicationName(GOOGLE_PRODUCT_NAME).
                build();

        Androidpublisher.Purchases purchases = publisher.purchases();
        Get get = purchases.get("XXXXX", subscriptionId, token);
        SubscriptionPurchase subscripcion = get.execute(); //LINE 1

In Google APIS Console the Service "Google Play Android Developer API" is enabled.
GOOGLE_CLIENT_MAIL is the email address from API Access from the Google Console.
GOOGLE_KEY_FILE_PATH is the p12 file downloaded from the API Access.
GOOGLE_PRODUCT_NAME is the product name from the branding information.

The code return in LINE 1:

"domain" : "androidpublisher",
"message" : "This developer account does not own the application.",
"reason" : "developerDoesNotOwnApplication"

Original issue: http://code.google.com/p/google-api-java-client/issues/detail?id=533

Metadata

Metadata

Assignees

Labels

importedpriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions