How to get authorization for accessing Google Play developer API

倖福魔咒の 提交于 2021-01-02 07:08:28

问题


I am trying to access Google play developer API https://developers.google.com/android-publisher/ to build an inapp purchase product for my company Application.

We have to get authorization to make a GET call to the Google play developer API. https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get

I followed the steps presented here. https://developers.google.com/android-publisher/authorization

Created an Oauth client and and also service account. The gmail account I used was part of the 'Users and permissions' in play.google.com console.

But when I tried to access the API, I got an error

As I started searching about this error, I understood that there is something else called 'API Access' in play.google.com. When I tried to access it, All I saw was

But I saw in other posts that there exists a screen with details like https://i.stack.imgur.com/Hdjjy.png

So how can I go forward to access API. I did everything as mentioned in documentation of google but it didnt work. Also I dont have access to see the screen of 'API Access'.

Also I am confused, if you can create service accounts from both 'API Access' screen and also from 'credentials' screen in console.developers.com, which one should be used ?


回答1:


Just to check you understand there are a few different APIs to do with in-app purchases.

  • Play billing library is designed to be used in your app. This is what allows users to buy things from your app
  • Configuring in app products. When your app supports in-app products you have to support what the products are and the prices. This is done via the Play console, either manually or in batches uploading CSV files.
  • Finally is the API you refer to in your question. This is not designed for use in your app, and you don't have to use it to support in-app products. Instead this API allows your server (not app) to validate a user's purchase. In order to use this API, you need to enable the "API access" in the page you found. This can only be enabled by the account owner for the Play console, for security reasons. You will need to find the Owner of your Google Play account, and get them to log in and create a service account which has API access.



回答2:


I am able to access it now. I am not the owner of the Google Play console.That was the issue. You just have to go to API Access page and click on "create OAuth Client" or "create Service Account ".

You can use those credentials to access API from postman or through your code.



来源:https://stackoverflow.com/questions/52471362/how-to-get-authorization-for-accessing-google-play-developer-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!