How to authenticate with Google Email Settings API using service account oauth2 Python client?
问题 I'm using Python 2.6 and the client library for Google API which I am trying to use to get authenticated access to email settings : f = file(SERVICE_ACCOUNT_PKCS12_FILE_PATH, 'rb') key = f.read() f.close() credentials = client.SignedJwtAssertionCredentials(SERVICE_ACCOUNT_EMAIL, key, scope='https://apps-apis.google.com/a/feeds/emailsettings/2.0/', sub=user_email) http = httplib2.Http() http = credentials.authorize(http) return discovery.build('email-settings', 'v2', http=http) When I execute