I want to make server-to-server requests to Google Analytics. I'm using Python, webapp2, App Engine. Because I use App Engine, I already have service account and I downloaded its API key:
{
"type": "secret",
"project_id": "secret",
"private_key_id": "secret",
"private_key": "secret",
"client_email": "secret",
"client_id": "secret",
"auth_uri": "secret",
"token_uri": "secret",
"auth_provider_x509_cert_url": "secret",
"client_x509_cert_url": "secret"
}
I'm following this tutorial but get_access_token()
throws an error. While debugging the library, I discovered the code expects json fields
json_data['_service_account_email'],
scopes=json_data['_scopes'],
private_key_id=json_data['_private_key_id'],
client_id=json_data['client_id'],
user_agent=json_data['_user_agent'],
What I'm doing wrong? I'm using oauth2client that comes with google_api_python_client.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…