[英]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
的下一步是什么GET https://www.googleapis.com/androidpublisher/v2/applications/your_package_name/reviews? access_token=your_auth_token
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目錄中有一個類似的示例。
類似的方法在運行這一點在對代碼Edits.apks:列表法
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.