Reputation: 389
This happens when I was using Google Play Android Developer API in Google Developers Console to test the status of purchased product, and the result is always like this
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "projectNotLinked",
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
],
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
}
Have checked this out using another Developer account (and package name) and it works just fine. I sure have linked the API project from Google Developers Console to Google Play Developer Console -> API Access settings, and try to recreate as many as possible but none of the projects worked.
So what am I missing here? What does it mean "not linked" besides the linked project I made in the settings of Google Play console.
Upvotes: 18
Views: 12481
Reputation: 11
I have exactly the same issue. but i have resolved . [request]: - you must link project Google Play Developer Console before you create inapp purchase
Upvotes: 1
Reputation: 321
Make sure the InApp-product is created after linking the API-project.
If you (like me) created the InApp-product first, and then linked the API-project afterwards, you will not be able to call any of the androidpublisher.purchases.* endpoints without getting the "projectNotLinked"-error. Neither from code or via the API-explorer.
You can verify this is the problem by calling androidpublisher.inappproducts.list. If this succeeds, your API-project is correctly linked to the Google Play Console...
It will not help to recreate users in Google API's. Nor to change authentication between OAuth 2.0 client IDs or Service account keys. Everything will work as expected when you create a new InApp-product after linking the API-project.
Upvotes: 10
Reputation: 171
In case anybody else has the same issue, try adding a new product/subscription in your Google Play console account. That worked for me, although seems to be some kind of inconsistency problem in Google services.
Upvotes: 13
Reputation: 11996
The APIs Explorer doesn't appear to work with v2 of the API. A bug has been reported: https://code.google.com/p/google-apis-explorer/issues/detail?id=268
Upvotes: 1
Reputation: 470
You need to link the project in the Google Play Developer Console under Settings -> Api Access.
See my complete answer here: https://stackoverflow.com/a/25825907/1745234
Upvotes: 2
Reputation: 389
After days trying to use API Explorer to use Android Publisher API but failed, I requested support from Google and receive the answer "It looks like API Explorer is no longer supported for the Publishing API". So basically I can't use API Explorer to check in-app purchase token again. Hope this help who's struggling with this.
Upvotes: 10
Reputation: 461
I got the same error message when using a "SERVICE ACCOUNT" for authentication. But everything works fine when using a OAuth client of type "installed application". To fix:
Upvotes: 0
Reputation: 8756
I got this too and just gave up on getting it to work, instead switching back to v1.1 of the API:
final URL url = new URL(
"https://www.googleapis.com/androidpublisher" +
"/v1.1/applications/" + "com.example.app.id" +
"/subscriptions/" + subcriptionId +
"/purchases/" + googlePurchaseReceipt +
"?access_token=" + googleAccessToken);
Hopefully someone will post a better answer sometime and we can all switch to v2 of the API.
Upvotes: 2