gmail api gives failedPrecondition error
I can't get gmail api to work. I'm using server-to-server authentication with JWT. google-api-python-client==1.4.0 httplib2==0.9 oauth2client==1.4.7 pycrypto==2.6.1 My code looks like this. with open(CLIENT_SECRET_FILE) as f: data = json.loads(f.read()) private_key = data['private_key'] client_email = data['client_email'] credentials = SignedJwtAssertionCredentials(client_email, private_key, scope=OAUTH_SCOPE) http = credentials.authorize(http) gmail_service = build('gmail', 'v1', http=http) try: threads = gmail_service.users().messages().list(userId='me').execute() except Exception as e: