{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/533","labels_url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/533/labels{/name}","comments_url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/533/comments","events_url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/533/events","html_url":"https://github.com/chrsmithdemos/google-api-java-client/issues/533","id":59552583,"number":533,"title":"Google Play Android Developer API return 401","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-02T21:19:47Z","updated_at":"2015-03-02T21:19:49Z","closed_at":"2015-03-02T21:19:47Z","body":"```\nVersion of google-api-java-client (e.g. 1.5.0-beta)?\nGoogle Play Android Developer API v1-rev2-1.7.1-beta\n\nJava environment (e.g. Java 6, Android 2.3, App Engine)?\nJava 6\n\nDescribe the problem.\nServer return 401 Unauthorized: This developer account does not own the \napplication.\n\nHow would you expect it to be fixed?\n\n                        HttpTransport HTTP_TRANSPORT = new NetHttpTransport();\n                        JsonFactory JSON_FACTORY = new JacksonFactory();\n\n                         GoogleCredential credential = new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT)\n\t\t\t        .setJsonFactory(JSON_FACTORY)\n\t\t\t        .setServiceAccountId(GOOGLE_CLIENT_MAIL)\n\t\t\t        .setServiceAccountScopes(\"https://www.googleapis.com/auth/androidpublisher\")\n\t\t\t        .setServiceAccountPrivateKeyFromP12File(new File(GOOGLE_KEY_FILE_PATH))\n\t\t\t        .build();\n\t\t\t\n\t\t\tAndroidpublisher publisher = new Androidpublisher.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).\n\t\t\t\t\tsetApplicationName(GOOGLE_PRODUCT_NAME).\n\t\t\t\t\tbuild();\n\t\t\t\n\t\t\tAndroidpublisher.Purchases purchases = publisher.purchases();\n\t\t\tGet get = purchases.get(\"XXXXX\", subscriptionId, token);\n\t\t\tSubscriptionPurchase subscripcion = get.execute(); //LINE 1\n\nIn Google APIS Console the Service \"Google Play Android Developer API\" is \nenabled.\nGOOGLE_CLIENT_MAIL is the email address from API Access from the Google Console.\nGOOGLE_KEY_FILE_PATH is the p12 file downloaded from the API Access.\nGOOGLE_PRODUCT_NAME is the product name from the branding information.\n\nThe code return in LINE 1:\n\n    \"domain\" : \"androidpublisher\",\n    \"message\" : \"This developer account does not own the application.\",\n    \"reason\" : \"developerDoesNotOwnApplication\"\n\n```\n\nOriginal issue reported on code.google.com by `Jonhy.co...@gmail.com` on 20 Jun 2012 at 7:58"},"comment":{"url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/comments/76826571","html_url":"https://github.com/chrsmithdemos/google-api-java-client/issues/533#issuecomment-76826571","issue_url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/533","id":76826571,"user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T21:19:49Z","updated_at":"2015-03-02T21:19:49Z","body":"```\nSame problem here. This is the response we receive:\n{\n  \"code\" : 401,\n  \"errors\" : [ {\n    \"domain\" : \"androidpublisher\",\n    \"message\" : \"The current user has insufficient permissions to perform the requested operation.\",\n    \"reason\" : \"permissionDenied\"\n  } ],\n  \"message\" : \"The current user has insufficient permissions to perform the requested operation.\"\n}\n```\n\nOriginal comment by `zitroint...@gmail.com` on 25 Jun 2014 at 2:21"}}