Answer the question
In order to leave comments, you need to log in
How to give the simplest console application access to the Google API?
Good day
I need a simple console application that the user would launch, it would launch the browser and authorize the user in Google, and then display the number of contacts in his Google Contacts.
Piece of my code:
SCOPE = ['https://www.googleapis.com/auth/contacts']
APPLICATION_NAME = 'ddd'
CREDENTIALS_FILE = "c:/Users/ghost/Documents/GAPI/Calls Renamer.json"
# CREDENTIALS_FILE = "c:/Users/ghost/Documents/GAPI/Old App.json"
storage = Storage('info.dat')
credentials = storage.get()
if not credentials or credentials.invalid:
flow = client.flow_from_clientsecrets(CREDENTIALS_FILE, SCOPE)
flow.user_agent = APPLICATION_NAME
credentials = run_flow(flow, storage)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question