I actually want to reply my google play app's comments using this api: https://developers.google.com/android-publisher/reply-to-reviews#gaining_access But in here, it wants me to enter auth_token. First i added service account to my google play. After that, i created a key and i downloaded the json file for my key. Using this json file i tried to get auth. token but output of this code tells me that credentials are invalid and token is "none". I wanna solve this problem. Thanks.
from google.oauth2 import service_account
import googleapiclient.discovery
SCOPES = ['https://www.googleapis.com/auth/cloud-platform',
'https://oauth2.googleapis.com/token',
'https://accounts.google.com/o/oauth2/auth',
'https://www.googleapis.com/oauth2/v1/certs',
'https://www.googleapis.com/robot/v1/metadata/x509/myusername.gserviceaccount.com']
SERVICE_ACCOUNT_FILE = 'service.json'
credentials = service_account.Credentials.from_service_account_file(
SERVICE_ACCOUNT_FILE, scopes=SCOPES)
print(credentials._token_uri)
print(dir(credentials))
print(credentials.valid)
print(credentials.token)
Resources that i researched:
https://developers.google.com/identity/protocols/oauth2#serviceaccount https://developers.google.com/identity/protocols/oauth2/service-account#python_1 https://developers.google.com/android-publisher/reply-to-reviews#gaining_access
Note: Also people are sending their API requests like this:
service = build('drive', 'v3', credentials=credentials)
For example above code is for sending api request for google drive. How can i api for my purpose? For example i wanna access google play api using "build".