如何获得访问Google Play开发者API的授权 [英] How to get authorization for accessing Google Play developer API

本文介绍了如何获得访问Google Play开发者API的授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试访问Google Play开发者API

创建了Oauth客户端以及服务帐户.我使用的Gmail帐户是play.google.com控制台中用户和权限"的一部分.

但是当我尝试访问API时,出现错误

在我开始搜索此错误时,我了解到play.google.com中还有其他名为"API访问"的内容.当我尝试访问它时,我所看到的只是

但是我在其他帖子中看到存在一个屏幕,其中包含诸如 https://i.stack.imgur.com/Hdjjy.png

那么我该如何继续访问API.我做了谷歌文档中提到的一切,但没有成功.我也无权查看"API访问"屏幕.

我也很困惑,如果您既可以从"API访问"屏幕又可以从console.developers.com的凭证"屏幕中创建服务帐户,那么应该使用哪一个?

解决方案

仅检查一下您是否了解应用内购买有几种不同的API.

  • 播放计费库旨在在您的应用中使用.这就是允许用户从您的应用中购买商品的原因
  • 在应用产品中进行配置.当您的应用支持应用内产品时,您必须支持产品的价格和价格.可以通过Play控制台手动或批量上传CSV文件来完成此操作.
  • 最后是您引用的API 在你的问题.它不是为在您的应用程序中使用而设计的,您不必使用它来支持应用程序内产品.相反,此API允许您的服务器(非应用程序)验证用户的购买.为了使用此API,您需要在找到的页面中启用"API访问".出于安全原因,只能由帐户所有者针对Play控制台启用此功能.您需要找到Google Play帐户的所有者,并让他们登录并创建具有API访问权限的服务帐户.

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 ?

解决方案

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.

这篇关于如何获得访问Google Play开发者API的授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆