如何找出Google API相关方法
How to find out Google API related method
我需要在应用程序上获取星星数量,我找到了这个 Google API
https://developers.google.com/android-publisher/reply-to-reviews#retrieving_a_set_of_reviews
但我要在服务器到服务器之间进行,因此我使用服务器帐户解决方案
https://developers.google.com/identity/protocols/OAuth2ServiceAccount
此示例适用于 sqladmin,我不知道从哪里获得 androidpublisher
的示例,这是我的代码
from google.oauth2 import service_account
SCOPES = ['https://www.googleapis.com/auth/androidpublisher']
SERVICE_ACCOUNT_FILE = 'account.json'
credentials = service_account.Credentials.from_service_account_file(
SERVICE_ACCOUNT_FILE, scopes=SCOPES)
from apiclient.discovery import build
try:
service = build('androidpublisher', 'v2', credentials=credentials)
except Exception as e:
print(str(e))
到目前为止没有任何问题,我只需要知道实现此目标的下一步是什么GET https://www.googleapis.com/androidpublisher/v2/applications/your_package_name/reviews?
access_token=your_auth_token
您似乎在尝试访问 Review.list() 方法。
尝试将其放在 service
的值之后
reviews_list = service.reviews().list(packageName=package_name).execute()
作为参考,android-play-publisher-api 存储库的 python 目录中有一个类似的示例。
类似的方法是运行在this point in the code for the Edits.apks: list方法
我需要在应用程序上获取星星数量,我找到了这个 Google API
https://developers.google.com/android-publisher/reply-to-reviews#retrieving_a_set_of_reviews
但我要在服务器到服务器之间进行,因此我使用服务器帐户解决方案
https://developers.google.com/identity/protocols/OAuth2ServiceAccount
此示例适用于 sqladmin,我不知道从哪里获得 androidpublisher
的示例,这是我的代码
from google.oauth2 import service_account
SCOPES = ['https://www.googleapis.com/auth/androidpublisher']
SERVICE_ACCOUNT_FILE = 'account.json'
credentials = service_account.Credentials.from_service_account_file(
SERVICE_ACCOUNT_FILE, scopes=SCOPES)
from apiclient.discovery import build
try:
service = build('androidpublisher', 'v2', credentials=credentials)
except Exception as e:
print(str(e))
到目前为止没有任何问题,我只需要知道实现此目标的下一步是什么GET https://www.googleapis.com/androidpublisher/v2/applications/your_package_name/reviews?
access_token=your_auth_token
您似乎在尝试访问 Review.list() 方法。
尝试将其放在 service
reviews_list = service.reviews().list(packageName=package_name).execute()
作为参考,android-play-publisher-api 存储库的 python 目录中有一个类似的示例。
类似的方法是运行在this point in the code for the Edits.apks: list方法